mesh rotation and parent/child relationship

Started by ap, January 20, 2015, 02:24:25 PM

Previous topic - Next topic

ap

Hello

I am trying to load an object from file (loader returns array of Object3D) then use a dummy object as a base node (parent) for all objects (setting them each a parent), and then aligning the rotation of the mesh of each one of objects.
Does "rotateMesh" use the inherited transformations from the parent in order to rotate the mesh?

I am rotating the base node in order to set the right rotation, then call "rotateMesh" on all children, and then clearing the rotation from the parent.
I think this doesn't work as expected, am I missing something?

Thanks
A.P.

EgonOlsen

rotateMesh() doesn't take the parent's rotations into account.

EgonOlsen

If all you do are rotations, try to call getWorldTransformation() on the children, set the result as rotation matrix of the child and then call rotateMesh()...and then, of course, reset the rotation and remove the parent.