These questions of mine seem silly, but I don’t know how else to go about getting them answered…

How does LineNodePath work? None of the methods are documented in its class page, and this is what I came up with. It draws a single line across the middle of the screen, and testing has shown that this line is from both the p2-p3 line and p4-p1 line (they are on top of each other).

from pandac.PandaModules import *
from direct.directtools.DirectGeometry import LineNodePath
import direct.directbase.DirectStart

l = LineNodePath(render2d,'box',4,VBase4(1,0,0,1))
p1 = (-.5,-.5,0)
p2 = (-.5,.5,0)
p3 = (.5,.5,0)
p4 = (.5,-.5,0)

I don’t know beans about this class, but it’s all in Python and fairly easy to read. It’s clear that:


will draw a line from p1 to p2, then from p2 to p3, then from p3 to p4, and then from p4 to p1. You could have achieved the same thing with less effort using:


The reason that you only see a single line instead of a box is that you have aligned your points in the X-Y plane, but render2d is aligned in the X-Z plane, so you are looking at your box edge-on. Maybe you meant to define your points like this instead:

p1 = (-.5,0,-.5)
p2 = (-.5,0,.5)
p3 = (.5,0,.5)
p4 = (.5,0,-.5)