Make the Node turn not rotate?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Guest

Make the Node turn not rotate?

Post by Guest »

How does one turn an object around one axis? The setRotation() seems to move the object in a circle. I would like the object to turn 45%.

Thanks in advance!! :D :D :D
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

rotation() makes the object turn around its own point of origin.

If that point of origin is directly at the center of the object, then it will only 'turn' to use your wording. However, if that point of origin is somewhere other than the center, the object will 'seem to move in a circle' where the center of that circle is the point of origin.

If you are calling rotate on a model, you need to make sure you know where that model's origin is-- you are assuming it is at the center of the model, and apparently it is not.
a screen cap is worth 0x100000 DWORDS
NecromanX
Posts: 16
Joined: Sat Jan 24, 2004 6:01 pm

Post by NecromanX »

i d love to know myself how to rotate a node using its x axis instead of the y axis :p
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

when you call 'rotate' you simply tell it what axis(s) to rotate around.

rotate( degrees around X-axis, degrees around Y-axis, degrees around Z-axis )
a screen cap is worth 0x100000 DWORDS
Guest

Post by Guest »

What rotation function are you talking about? Because the API doesnet mention any call to rotation. which of these functions are you talking about:

setRotation()
RelitiveRotation()


Or some other one? The other rotation calls do not work on a scene node?

Thanks!
Guest

Post by Guest »

What rotation function are you talking about? Because the API doesnet mention any call to rotation. which of these functions are you talking about:

setRotation()
RelitiveRotation()


Or some other one? The other rotation calls do not work on a scene node?

Thanks!
Guest

Post by Guest »

What rotation function are you talking about? Because the API doesnet mention any call to rotation. which of these functions are you talking about:

setRotation()
RelitiveRotation()


Or some other one? The other rotation calls do not work on a scene node?

Thanks!
Guest

Post by Guest »

I am also trying to do this. I have tried the below call but none of the seem to work correctly.

Code: Select all

myNode->setRotation(core::vector3df(0,0,0.2f));
//moves the object down once but then does not do anything else

myNode->setRotation( myNode->getRotation()+ core::vector3df(0,0,-0.2f));
//This code rotates the object around some point that is no where near my scene
//I have also tried geting the position of my node and then using the rotateBy commands and they do the same this as above.

Please help

also sorry for the tripple post above I do not know what happend[/code]
Guest

Post by Guest »

also is there a way to set this point of origin? If not how in the world would I have gotten the point of origin moved the model is right where I loaded it and I have not moved it.
Chev
Posts: 37
Joined: Wed Nov 19, 2003 6:15 am

Post by Chev »

You'll have to take a look at the 3d model while in your 3d modelling software (Milkshape, 3ds max, etc.). When you open the model you will be able to tell if its polygons are truly at the model's origin (0,0,0) or if the polygons are shifted a certain distance away. Its pretty common to open or import a particular model and find that the polygons are not centered about the origin. Its kind of hard for me to explain, so just take a look at the model inside of your modelling software.
Guest

Post by Guest »

I looked in max and the teh corrdinance were set at (0,0,0). Surely there is a way to change this in irrlicht.
Guest

Post by Guest »

look here niko shows how to use a transparent light
http://irrlicht.sourceforge.net/tut008.html
Post Reply