Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

TolTol

Flt Sim Local coordinates => Global coordinates?

This topic is 5667 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I''m creating a flight simulator for college, I have 4 vectors representing the forces that act on the aeroplane (lift, thrust, drag & weight) which are referenced from the origin and 1 vector representing the aeroplane''s position. I''m using the OpenGL function "gluLookAt(vPos, vLook, vUp)" to set up the camera. My question is this..How do I transfer the local coordinate vectors lift and thrust to global coordinates so that I can use them in gluLookAt()? I''m putting the position vector as the first parameter, the thrust vector as the look parameter, and the lift vector as the up parameter. I''m currently adding the position vector to the up vector to transfer it to global coordinates but its giving me strange results. Any help or suggests would be muchly appreciated as I''m stuck at this problem for quite a while. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
I might not be understanding you correctly but, can't you just make your variables global? or do you have to send them over parameters?

eg:
//********************************

// any includes

#define WIN32_LEAN_AND_MEAN

float vpos; // New Global Variable

void main()
{
// float vpos; <---old variable

}

// Note: i know this isn't OpenGL or Windows API, just an example.

[edited by - JYoung on February 8, 2003 1:52:27 PM]

Share this post


Link to post
Share on other sites
Hum, I''m a bit confused, but I''ll give it a try. Try the position vector plus the thrust vector for the second parameter. You are at the first parameter looking at the second parameter with up in the direction of the third parameter. As near as I can tell you are more or less looking back at the worlds origin. Actually a displacement of the thrust vector from the world''s origin. gluLookAt is mainly to save you a bit of effort. I believe you could just put yourself into object space and use values relative to the plane''s origin. Your thrust is most likely straight down one axis and your up straight along another.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!