PDA

View Full Version : 2D rendering



King Fuzzy
05-20-2004, 12:03 AM
Is there a way to use opengl to do 2D rendering without perspective,
I want to use this for top, side and front views
of wireframe objects

paintor
05-20-2004, 01:30 AM
hi,

i believe you can use the gluOrtho2D function with the projection matrix to achieve this



glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0.0, 1.0, 0.0, 1.0);then use the modelview matrix with glRasterPos function.



glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glRasterPos3f(0, 0, 0.0);...

for more details OpenGL Red Book: Chapter 3 - Veiwing (http://fly.cc.fer.hr/~unreal/theredbook/chapter03.html)

hope this helps

DarkenedFetus
05-20-2004, 03:30 AM
Also, if you still want to draw polygons, etc., you can use glVertex2f(). (glRasterPos() is good if you're drawing pixels).