relative pos

how can i get a point’s position relative to cam len

something like

base.cam.getRelativePoint(point, (0,0,0))

That looks about right, is it not working?

base.cam.getRelativePoint(nodepath, (0,0,0)),it need nodepath,not point. I must create a node in the positon for it . is there a direct way ?

This NodePath represents the coordinate system in which the position of the point is defined. The second argument is the point itself.

If that node is attached to base.render (the “world”), then the point’s position is in world space; to get its position in camera space, do something like this:

pos_rel_to_world = Point3(7., 12., -3.)
pos_rel_to_cam = base.cam.get_relative_point(base.render, pos_rel_to_world)

Hope this helps :slight_smile: .

thanks! :laughing: