Re: [osg-users] Creating a Visible Pivoting Vector/Cylinder
Hi Tom, Thanks a lot for your input. I will be coding that out today so hopefully I can get that all set up! Thanks again, more info on the situation as it develops! ... Cheers, Richard -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=32190#32190 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Creating a Visible Pivoting Vector/Cylinder
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
[osg-users] Creating a Visible Pivoting Vector/Cylinder
Hi, I'm looking to write the code for a vector/a small diameter cylinder to pivot from the bottom, and traces to different points at the top with relation to data collected by a user interface device. Specifically I am tracking an IR LED with OSG in a cubic set space and would like a visible vector/cylinder to point to the LED's point in space. The vectors/cylinders are only for aesthetic purposes to get more of a feel of where the LED is in relation to the cubic defined space. Any/all help is greatly appreciated. I've been just learning this on my own and am new to OSG's specific operation! :-D ... Thank you! Cheers, Richard -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31992#31992 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org