Hi Richard,

You seem to have a lot of the pieces already sort of in place.  I'm not sure 
exactly what you're asking... but here goes.

To have something render, you want to create an object of class 
osgViewer::Viewer.  Then you need to add data (your scene graph) to the viewer 
using setSceneData(osg::Node*).  In your case, this will be the 
PositionAttitudeTransform node (vectorOrient), which has the update callback 
attached and the geode (lineVector1) as a child as you've already done.  Then 
you need to call viewer.run(), or create a loop with viewer.frame() within it.

In the callback, it sounds like you want to set the attitude(rotation) of the 
PAT node.  So, instead of calling setPosition(Vec3), you want to use 
setAttitude(Quat).  The Quat class has a makeRotate method which creates a 
quaternion to rotate from one vector to another.  So you want to have two 
vectors, one which points in the initial direction of the line you want to draw 
(defined when you created the geometry) and the other which points in the 
desired direction depending on your dynamic data.  Once you have those vectors, 
do moveVector->setAttitude(osg::Quat::makeRotate(initial_vec, final_vec)).

Hope that helps you get started,
Tom

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=35879#35879





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to