Jump to content
  • Advertisement

Archived

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

The Beholder

OpenGL Changing OpenGL coord system

This topic is 5453 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. From mathclasses in school I''ve got used to a right-handed coordinate system with x to the right, y inwards (the screen) and z upwards. I was wondering if I can change the default OpenGL coordinate system to this one?

Share this post


Link to post
Share on other sites
Advertisement
easy:


float mat[16] =
{ //flip y and z axes

1, 0, 0, 0,
0, 0, 1, 0,
0, 1, 0, 0,
0, 0, 0, 1};

glMatrixMode(GL_MODELVIEW);
glLoadMatrix(mat);

Share this post


Link to post
Share on other sites
Thanks. I solved it just by letting my camera''s up-vector point in positive z-direction and the view-vector in positive y-direction. Problem solved!

I am using gluLookAt for my camera class and I guess it uses matrix manipulation in a similar way to what you proposed

Share this post


Link to post
Share on other sites
gluLookAt is slow and form glu and you must send too many parameters, better to create your own MyLoadModelviewIdentity() function with 666_1337''s code, static float matrix and maybe a little shorter identifier



...::why don''t we have assembler forum?::...

Share this post


Link to post
Share on other sites
Firstly, opengl uses a right handed coordinate system so you don''t need to change it.

As for gluLookAt being slow... I''ve heard this before, but realistically can it really make any significant difference?

I would assume at most you call it a few times per frame, and that MOST of the time it is called 1 time per frame. How could any opengl function that is called one time per frame be so slow that "optimizing" it would make a noticeable difference....


Jeff

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!