Code: Select all
node.Rotation.RotateYZby()
The main issue is im not sure how hey X, Y, Z axis are placed in irrlicht could somebody please clarify?
Code: Select all
node.Rotation.RotateYZby()
Great explanation!!Mel wrote:Place yourself in the origin of coordinates. Vector X (1,0,0) points right, VectorY (0,1,0) points up and vectorZ, (0,0,1), In Irrlicht, points in front of you. To modify your heading, you must rotate around the Y axis, to change your pitch, you have to rotate around the X axis, and to change your banking, you spin around the Z axis. It is easier to see than to explain.
Or, in aircraft terms, pitch = rotate around X, yaw = rotate around Y and roll = rotate around Z. I hope you get it ^^U i am not too good explaning this
Code: Select all
while(true)
{
...
shipNode->setRotation(shipNode->getRotation()+core::vector3df(0,1.0f,0));
...
drawAll();
}
Mel wrote:export it rotated... To turn the models horizontally, you rotate around the Y axis. Irrlicht uses sexagesimal degrees as the measure of the rotations, and counter clock wise is the orientation, being the 0 degrees the angle of the X axis and a 90 degrees rotation in the Y axis is a turn to the left, pointing towards the positive Z axis.
Irrlicht uses quaternions also to specify the rotations.
So, first answer: Use degrees as your measurement unit.
second answer: rotate the model -90 (or 270 degrees) in the Y axis.
A small example: Try this so you get it clear:then change the position of the angle increment (change the axis), and see how the ship reacts.Code: Select all
while(true) { ... shipNode->setRotation(shipNode->getRotation()+core::vector3df(0,1.0f,0)); ... drawAll(); }
Code: Select all
c=node1->getRotation().Y;
c=c+0.01f;
node1->setRotation(core::vector3df(0,c,0));
Code: Select all
swprintf(tmp, 1024, L"Spinning: ", c);
device->setWindowCaption(tmp);
Maybe you could look at using an animator like the rotation animator, this tutorial will show you how to use them: http://irrlicht.sourceforge.net/docu/example004.htmlNash94 wrote:What im trying to is get the object spin around..
You could set rotation when you press a key, for example you press the up key and the object rotates, this way you can get the object in the exact position.Nash94 wrote:However the problem is it seems to reach very high numbers very quick.