Global position

Hi, I new to Panda3d and I have a question (I’m very cliche). How can I get the global position of a node if the said node has a parent? I have already searched the manual/list of classes/functions/methods but they weren’t very helpful.

You mean you have to get the position of the node relative to render, the top node. To do that, specify render as first parameter of getPos:

nodepath.getPos(render) # get global pos

And there you have the global position. You can also use setPos the same way:

nodepath.setPos(render,1,2,3) # set global pos

Thank you very much.

Yes thanks, I didn’t know that and I’ve been using Panda for a year now :smiley: