Skip to main content
GameDev.net gamedev.net
🔒 Locked

flying around

Started by NerdAndy Sep 19, 2005 at 5:27 PM 2 replies 750+ views
Original Post
NerdAndy
NerdAndy
hi everyone am making a fun game for me. lol and am trying to fly my mesh(a jet) around. i have 1 problem. i wnat to move my mesh in the direction its pointing in after setting the pitch,yaw,roll. am not using real physics. the speed is constant if the user leave the "space" for more the 10sec he will die. note: only need help with the math. thanks
I just want to be better than "you" ;-(
Zakwayda
Zakwayda
All you need to do is extract the direction vectors for the airplane from its orientation matrix. As for how to do that, it depends on what API you're using, if you have your own matrix library, etc. So you might provide some more information.
NerdAndy
NerdAndy
Quote:
Original post by jyk
All you need to do is extract the direction vectors for the airplane from its orientation matrix. As for how to do that, it depends on what API you're using, if you have your own matrix library, etc. So you might provide some more information.


am using C# and Manage DirectX

I just want to be better than "you" ;-(
Zakwayda
Zakwayda
Quote:
am using C# and Manage DirectX
Still don't know enough to say for sure, but the following should work.

Create your airplane orientation matrix, presumably using the DirectX 'yaw, pitch, roll' function. Then extract the basis vectors from the matrix as follows:

Vector3 x(m11, m12, m13);
Vector3 y(m21, m22, m23);
Vector3 z(m31, m32, m33);

Or with 1d indexing:

Vector3 x(m0, m1, m2);
Vector3 y(m4, m5, m6);
Vector3 z(m8, m9, m10);

These will be the side, up, and forward direction vectors for your airplane. Which is which depends on how your model is oriented initially.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.