Left handed coords vs right handed

Started by
4 comments, last by duckbob 22 years, 3 months ago
is there a way to make opengl use the left handed system of coordinates vs the right handed system?
Advertisement
You mean have the x coords all negative ?

well, theres a function called glOrtho(......) that takes 6 arguments;

the first two are the minimum x coords then the maximum x coords, and the same for the next 4, only for y, then z.

so a call like

glOrtho(-100, 0, -100, 0, -100, 0);

is probably what you are looking for.. I cant word it well, just look for that function online or through references.



the difference between left handed and right handed is the "view direction".

By default(no rotation), on a right handed coordinated system you are looking in Z+ direction. On a left-handed you are looking at Z-.

So, before doing any modelview transformation, just do the following call

glScalef(1,1,-1);







glFrontFace( GL_CCW); // default
glFrontFace( GL_CW); // what you want
quote:Original post by Prosper/LOADED
glFrontFace( GL_CCW); // default
glFrontFace( GL_CW); // what you want


Not necessarly.

here is what i''m talking about, i just hope this displays in fixed width font

*....z
.....|
.....|
x----y right handed

z....*
|.....
|.....
y----x left handed

open gl is using the right handed system so incressing x values will move a point left when looking along the z axis from the - side. that means a point that is 45 degrees against the x axis is where the * is in the top diagram...now when i learned math i always thought in the left handed system...so when i am working everything i do winds up fliped along the z axis. that make any sence? i want to switch it so that incressing x values will make a point move right instead of left when viewd from the -z axis.

duckbob

This topic is closed to new replies.

Advertisement