setposition help in getting this matrix to work

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!
Post Reply
Yokom
Posts: 30
Joined: Sat Oct 09, 2004 10:50 pm

setposition help in getting this matrix to work

Post by Yokom »

x'=z*sin(yaw)+x*cos(yaw)
y'=y
z'=z*cos(yaw)-x*sin(yaw)

x"=x'
y"=y'*cos(pitch)-z'*sin(pitch)
z"=y'*sin(pitch)+z'*cos(pitch)

x"'=y"*sin(roll)+x"*cos(roll)
y"'=y"*cos(roll)-x"*sin(roll)
z"'=z"

ok with this i sould be able to move an abject in roll pitch and yaw. Lets say i set the setposition command to use the varibles spx,spy,spz. The if i wanted to yaw say 2.0f what math would i use. The truth is im pretty confused on this math.
Yokom
Posts: 30
Joined: Sat Oct 09, 2004 10:50 pm

Post by Yokom »

well we got matrix4 to work to do the translation of these but it odd and i dont think i understand how its doing it and that bothers me a bit, but meh i guess i should just get used to not knowing what the engine is doing or how its doing it just work on the things i need to.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Yokom
Posts: 30
Joined: Sat Oct 09, 2004 10:50 pm

Post by Yokom »

The problem of getting the ship to roll pitch and yaw is good. Thanks to arras for the tips on the matrix4.

But now it seems all was for naught as we are having a hard time getting a camera to set in the cockpit of the ship and do the same rotation as the ship. So the pilot can know how his ship is positioned and what is right in front of him.

we tried to setTarget to the getrotation of the ship. That seemed like it should have worked. But setTarget is not where the camera should be pointing but what it is pointing at.

not sure what to do now.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

you can find my cockpit camera here:

http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2892

parent node is ship node to which camera is attached as child.

target vector v actualy dont have to be vector3df(0, 0, 100) enough is vector3df(0, 0, 1)
Post Reply