I’m learning OpenGL and having a hard time finding a clear definition of the coordinate system.
How can you tell what numeric range of values will show up in the viewport?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
-1.0 to +1.0 (after all transformations are applied).
This information is buried in the
glViewportdocumentation in a somewhat roundabout way. I’m choosing the MSDN version of the documentation because more other online sources mangle the formula during conversion to HTML (it’s the correct formulat, but not recognizable).You can get any pre-transformation coordinate system you want by applying appropriate scaling and translation factors.
glOrthomakes this easy in GL 1.x – 2.x. In OpenGL 3.x, you use a vertex shader to do transformations.