Changing OpenGL coord system

Started by
4 comments, last by The Beholder 20 years, 8 months ago
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?
Advertisement
You can''t change the OpenGL coord system itself but you can make a rotation of PI/2 on the X axis to get the coord system you''re used to.
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);
our new version has many new and good features. sadly, the good ones are not new and the new ones are not good
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
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?::...
When I was younger, I used to solve problems with my AK-47. Times have changed. I must use something much more effective, killing, percise, pernicious, efficient, lethal and operative. C++ is my choice.
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
super genius

This topic is closed to new replies.

Advertisement