In Place Rotation

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Thulsa

Post by Thulsa »

Guest,
look at the demo of dhenton9000. His cube does exactly what it should do.
Try to make things easier. Take only one of your cylinders (motors) move them to global 0,0,0 in your modeler. Animate it using dhenton9000's code. If that works, attach only one node after another...
Guest

Post by Guest »

but his cube is already on 0,0,0 and moved it 20,20,20...thats what I understood from the code...Mine is kindof different that it is already on a different coordinates...

Anyway, i used updateAbsolutePosition and it still doesnt work...
Thulsa

Post by Thulsa »

:twisted: holy driver!
That's the way it works. ANY rotation axis will ALWAYS go thru the Origin of the (body relativ) coordinate system.

Step 1: Move every motor with your modeller to O and save it to disk. Afterward use sceneNode->setPosition() to move the body back to the desired position in irrlicht.

Step 2: With the arms its a little bit different. The origin of the model (as the axis of rotation) should be be located not in the middle, but on one end of the bar. Again, as they are transformed within the modeller, use irrlicht to move them back to desired position.

Step 3: To work properly together, both rotation axis should now coincide. In the end you may set the bar (arm) as child of the motor.
Post Reply