[osg-users] Moving on a surface

T.R.Shashwath trshash at gmail.com
Sun Sep 7 00:57:55 PDT 2008

Hello everyone,
I've just been trying out OSG, and I have some questions I've not been able to 
answer by reading the docs.

I've got one object (loaded from a .3ds file), and I want to position an 
object on it, to move on the surface (call it the bot). The way I thought of 
doing it is to use a LineIntersector to the Z-direction of the bot, and 
whenever it moves forward, find the point right underneath it, and snap it 

What I want to find out is how to position the bot on the object in the first 
place. When I made a similar mover in VTK, I found the closest point on the 
surface to the world origin, and positioned my bot there. Assuming the normals 
are unified (either all inside or outside), I can position the guy on the 
outer surface after this. I've not been able to find a similar function 
anywhere in OSG.

Second, I'd like to have a way of recording a particular path that the bot has 
followed over the surface, for replay later. I would also like to be able to 
load this path from a file, or specify a point on the surface (possibly in a 
radial coordinate system) and position the bot directly on it. 

Does anyone know of a way to do these things?

More information about the osg-users mailing list