Draw a line to an object in kiss3d

Hi, sorry for this offtopic question, but I believe people here might be using kiss3d with nphysics and could be able to help.
I’m learning how physics engines work and trying to use kiss3d to render my simulations, and stuck on a simple thing: I need to draw a line (it will represent a spring) from some fixed point to my object. To draw it I need two nalgebra::Point’s and they require raw coordinates. But I don’t know how to get x and y coordinates of an object in kiss3d. SceneNodeData has local_transform, but I wasn’t able to figure out how to get values from it.

Would be very grateful for the help, thanks!

P.S. I have a guess that my approach is wrong and probably I shouldn’t work with rendered nodes coordinates, if so - please let me know what’s the correct way to do that


Sorry for the late answer. If you need to draw a line from a point fixed on your object, I guess you already have the coordinates of this point expressed in the local-space of this object (i.e. the position of the point wrt. the object itself). In that case, all you need to do is multiply: scene_node.data.world_transformation() * local_point.

1 Like

Thanks for the reply, I will try it!