3dvectors and node rotation

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
MarvLeonidasX
Posts: 15
Joined: Fri Oct 09, 2009 2:54 pm

3dvectors and node rotation

Post by MarvLeonidasX »

So, a node's rotation is based on a vector3d, and a vector3d is made up of an x, y, and z of type s32 or f32. So what does the value of say z represent? Is it a range 2147483647 to -2147483648 ? Obviously not degrees unless we do some division. How would I make a 90 degree change to one of a vector's x/y/z? Is there a 3dvector function that rotates itself toward a specific point in 3d space? Like if I click on a spot the node can be rotated toward that spot? I'm sleepy and I am rambling.
"Mission failed: Your team was wiped out."
DavidJE13
Posts: 165
Joined: Tue Jan 09, 2007 7:17 pm

Post by DavidJE13 »

the range is 0-360 - it's in degrees. anything outside this range is modulated.

they represent yaw, pitch and roll (look them up on wikipedia for a good explanation)

for more intuitive rotations, take a look at quaternions in the API - these let you specify a vector to rotate around and an angle to rotate by, then can output a vector3df to use when setting the rotation of a node.

as for looking at a particular point, I don't know of a function in Irrlicht but the math is already there. Take a look at how the camera object does it in the source (when it has target and rotation bound it'll do the conversion). If you just want to look roughly at a point on the screen it's even easier - just play with yaw and pitch.
MarvLeonidasX
Posts: 15
Joined: Fri Oct 09, 2009 2:54 pm

Post by MarvLeonidasX »

Thanks for the tip. It sounds like quaternions ARE the droids I'm looking for! And looking at the source code is a brilliant idea. I spent so much time scouring the API documentation that I didn't even think of the actual source. Dee tuh dee.
"Mission failed: Your team was wiped out."
Post Reply