How to understand the setPos

For a box, the code should be:

shape = BulletBoxShape(Vec3(0.5, 0.5, 0.5))
node = BulletRigidBodyNode('Box')
node.setMass(1.0)
node.addShape(shape)
np = render.attachNewNode(node)
np.setPos(0, 0, 1)
world.attachRigidBody(node)

The position is set to 0, 0, 1.

Which point has the 0, 0, 1 position?

image

For the eight points of box, which point has the 0, 0, 1 position? Is it d or the center of box?

It has nothing to do with the shape of the geometry. Here you can understand how NodePath works.

https://docs.panda3d.org/1.10/python/more-resources/cheat-sheets

1 Like

Thanks ~~~

I believe BulletBoxShape is centered on the middle point. So in your situation, the (0, 0, 1) is in the center of the box.