Thunder0ne
10-06-2006 22:14:17
Hi,
I wrote a parser to load the scene exported by ofusion.
I am proceeding as follows
1) all the scene meshes have their own pivot centered into them
2) all the pivots are aligned to the world coordinates
3) when I load the scene I attach every entity to its own SceneNode which is child of a main SceneNode placed in the wolrd origin which is child of the scene root node. I do this as follow
where x,y,z are the numbers in the "position" XMl tag
By mistake I was ignoring the "rotation" tag in the XML file that ofusion makes on scene exporting, but everything was fine maybe because every pivot was aligned to the world axis.
Which SceneNode method should I invoke on scene loading to correctly load the scene if I use pivot that are centered to object but not world axis aligned?
Is something like this correct?
where w,x,y,z are the mubers in the "rotation" XML tag
I wrote a parser to load the scene exported by ofusion.
I am proceeding as follows
1) all the scene meshes have their own pivot centered into them
2) all the pivots are aligned to the world coordinates
3) when I load the scene I attach every entity to its own SceneNode which is child of a main SceneNode placed in the wolrd origin which is child of the scene root node. I do this as follow
entityNode = mOriginSceneNode->createChildSceneNode(entName+"_node",Ogre::Vector3(x,y,z));
where x,y,z are the numbers in the "position" XMl tag
By mistake I was ignoring the "rotation" tag in the XML file that ofusion makes on scene exporting, but everything was fine maybe because every pivot was aligned to the world axis.
Which SceneNode method should I invoke on scene loading to correctly load the scene if I use pivot that are centered to object but not world axis aligned?
Is something like this correct?
Ogre::Quaternion rotQuat(w,x,y,z);
entitySceneNode->rotate(rotQuat,Ogre::Node::TransformSpace::TS_WORLD);
where w,x,y,z are the mubers in the "rotation" XML tag