Changing OpenGL coord system
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?
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);
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
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?::...
...::why don''t we have assembler forum?::...
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement