Hello Dave,
> By tweaking and hacking, I was able to make things move. Using an simple
> scene with a floor, and the cow, with this heirarchy:
>
> root -- group -- PositionAttitudeTransform -- MatrixTransform -- Geode(cow)
>
> If I grab the MatrixTransform node, and postMultiply it's matrix with a
> translation matrix, I can make the cow move. However, to get this to
> work in the general case, I need to obtain the localToWorld/worldToLocal
> mtx for the geode, and use it, with the position of the hand-held wand
> to create a new matrix for this geode that positions it on the wand.
>
> Does that make sense?
Yep, that's the gist of it. Just parent the node(s) you want to be
able to move/transform to a MatrixTransform or
PositionAttitudeTransform (whichever you like most) and use that to
transform your node the way you want. What you do with the node
depends on what you want to do, so you'll have to find the maths for
the effect you want by yourself...
BTW, you don't need 2 transform nodes. One is enough, it just depends
on what you like more: manipulating transformation matrices or
manipulating translation vector, rotation quaternion and scale vector
independently. Under the hood, OSG does the math to convert a PAT to
matrix representation and use that for rendering.
FYI, I've used OSG in a CAVE before and doing what you want is pretty
easy. You just have to get a hang of what OSG provides you and work
with that as you would with the more low-level tools (straight OpenGL
and vector/matrix math). Toward that end, I suggest you always keep
the Doxygen for your version of OSG open as you work, so you can look
through the classes and see what's available. It's pretty intuitive,
just a bit overwhelming at first.
Good luck,
--
______________________________________________________
Jean-Sebastien Guay [EMAIL PROTECTED]
http://whitestar02.webhop.org/
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org