3dvectors and node rotation
-
- Posts: 15
- Joined: Fri Oct 09, 2009 2:54 pm
3dvectors and node rotation
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."
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.
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.
-
- Posts: 15
- Joined: Fri Oct 09, 2009 2:54 pm