Hi Richard,

Here's what I would do to start:

0) Read the QuickStartGuide if you haven't already.

1) Make two Geodes, one with a Cylinder as the Drawable, and the other with a 
Cone, (these are convenience classes which the osg provides) and add each Geode 
as the child of a MatrixTransform or PositionAttitudeTransform node.  

2) Derive a class(es) from NodeCallback, overriding the operator()(Node*, 
NodeVisitor*) method with the behavior you want for each component of your 
arrow (setting the orientation or scaling or whatever you want) based on the 
interface device data.  Matrix::rotate(Vec3 from, Vec3 to) will create a 
rotation matrix which rotates your objects from some starting orientation - the 
original axis of your arrow - to another orientation - the desired axis of your 
arrow.

3) Attach the callback(s) to the appropriate transform node(s) using 
Node->addUpdateCallback(derivedCallbackClass)

4) Add your root node as the scene data of an osgViewer::Viewer, and either do 
a frame() loop or viewer.run().  The QuickStartGuide will have everything you 
need to know about that.

Hopefully that'll get you started...

Cheers,
Tom

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





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to