Is OpenGL ES 2.0 equivalent to glOrtho ()?

In my iphone application, I need to project a 3d scene into the 2D coordinates of the screen for some calculations. My objects undergo various rotations, translations and scaling. So I decided that I need to first multiply the vertices by the ModelView matrix, then I need to multiply it by the matrix of orthogonal projections.

First of all, on the right track?

I have a model view matrix, but I need a projection matrix. Is there an equivalent to glOrtho () in ES 2.0?

+5
source share
2 answers
mat4 projectionMatrix = mat4( 2.0/768.0, 0.0, 0.0, -1.0,
                              0.0, 2.0/1024.0, 0.0, -1.0,
                              0.0, 0.0, -1.0, 0.0,
                              0.0, 0.0, 0.0, 1.0);                        

gl_Position = position;
gl_Position *= rotationMatrix;
gl_Position.x -= translateX;
gl_Position.y -= translateY;
gl_Position *= projectionMatrix;

(1024x768 iPad) , :) , : glOrtho.html

+13

glOrtho() , , , .

+3

All Articles