simulation.py
def _addGrid(self): # {{{0
    "Draw a grid on the world floor"
    wm = self.worldSizeMax()
    for i in range(int(round(wm))):
      # Draw a line from (-wm, i) to (wm, i)
      p1 = self.worldFloor() + V3(-wm, i, 0)
      p2 = self.worldFloor() + V3(wm, i, 0)
      self.drawLine(p1, p2, color=C_NONE)
      # Draw a line from (-wm, -i) to (wm, -i)
      p1 = self.worldFloor() + V3(-wm, -i, 0)
      p2 = self.worldFloor() + V3(wm, -i, 0)
      self.drawLine(p1, p2, color=C_NONE)
      # Draw a line from (i, -wm) to (i, wm)
      p1 = self.worldFloor() + V3(i, -wm, 0)
      p2 = self.worldFloor() + V3(i, wm, 0)
      self.drawLine(p1, p2, color=C_NONE)
      # Draw a line from (-i, -wm) to (-i, wm)
      p1 = self.worldFloor() + V3(-i, -wm, 0)
      p2 = self.worldFloor() + V3(-i, wm, 0)
      self.drawLine(p1, p2, color=C_NONE)
Draw a grid on the world floor
Draw a grid on the world floor
Draw a grid on the world floor
def _addGrid(self): 
    wm = self.worldSizeMax()
    for i in range(int(round(wm))):
      p1 = self.worldFloor() + V3(-wm, i, 0)
      p2 = self.worldFloor() + V3(wm, i, 0)
      self.drawLine(p1, p2, color=C_NONE)
      p1 = self.worldFloor() + V3(-wm, -i, 0)
      p2 = self.worldFloor() + V3(wm, -i, 0)
      self.drawLine(p1, p2, color=C_NONE)
      p1 = self.worldFloor() + V3(i, -wm, 0)
      p2 = self.worldFloor() + V3(i, wm, 0)
      self.drawLine(p1, p2, color=C_NONE)
      p1 = self.worldFloor() + V3(-i, -wm, 0)
      p2 = self.worldFloor() + V3(-i, wm, 0)
      self.drawLine(p1, p2, color=C_NONE)
def _addGrid ( self ) : wm = self . worldSizeMax ( ) for i in range ( int ( round ( wm ) ) ) : p1 = self . worldFloor ( ) + V3 ( - wm , i , 0 ) p2 = self . worldFloor ( ) + V3 ( wm , i , 0 ) self . drawLine ( p1 , p2 , color = C_NONE ) p1 = self . worldFloor ( ) + V3 ( - wm , - i , 0 ) p2 = self . worldFloor ( ) + V3 ( wm , - i , 0 ) self . drawLine ( p1 , p2 , color = C_NONE ) p1 = self . worldFloor ( ) + V3 ( i , - wm , 0 ) p2 = self . worldFloor ( ) + V3 ( i , wm , 0 ) self . drawLine ( p1 , p2 , color = C_NONE ) p1 = self . worldFloor ( ) + V3 ( - i , - wm , 0 ) p2 = self . worldFloor ( ) + V3 ( - i , wm , 0 ) self . drawLine ( p1 , p2 , color = C_NONE )
Draw a grid on the world floor
Draw a grid on the world floor
# {{{0 "Draw a grid on the world floor" # Draw a line from (-wm, i) to (wm, i) # Draw a line from (-wm, -i) to (wm, -i) # Draw a line from (i, -wm) to (i, wm) # Draw a line from (-i, -wm) to (-i, wm)
self