Hi Ümit,
I try to use osg::Switch to insert all the data I have in the files( each file
in a separate node with his own transform matrix ), so I can switch the nodes
in each frame, but I don't know why it seems that the second and following data
I insert accumulates the previous matrix transformation, and I don't want this.
I write "it seems" because I cannot be sure about that, my models are doing
some strange movements that are not correctly. I also have a sphere attached to
the root node after I attach the switch node, and it seems to be also afected
by the previous transformation... Althought, that's not my biggest problem, I
can just fix it by adding and deleting one by one the nodes to the root node.
My problem is that the transformation I apply in OGL is not the same as in OSG,
and I need the same transformation. So the gridOrientation is a Matrix3x3 wich
contains the rotation in the object. , that's why I'm adding some more values.
My matrix rotation in OGL is like that:
gridOrientation.set(0,0,rotation.get(0,0));
gridOrientation.set(0,1,rotation.get(1,0));
gridOrientation.set(0,2,rotation.get(2,0));
gridOrientation.set(0,3,0.0f);
gridOrientation.set(1,0,rotation.get(0,1));
gridOrientation.set(1,1,rotation.get(1,1));
gridOrientation.set(1,2,rotation.get(2,1));
gridOrientation.set(1,3,0.0f);
gridOrientation.set(2,0,rotation.get(0,2));
gridOrientation.set(2,1,rotation.get(1,2));
gridOrientation.set(2,2,rotation.get(2,2));
gridOrientation.set(2,3,0.0f);
gridOrientation.set(3,0,0.0f);
gridOrientation.set(3,1,0.0f);
gridOrientation.set(3,2,0.0f);
gridOrientation.set(3,3,1.0f);
As I can understand about the precedence of OGL and OSG, if I do translate and
then rotate in ogl, I have to do rotate * translate in OSG.... Otherwise, I've
tried both combinations, and no one is working... :S
Cheers,
Pau.
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15115#15115
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org