Advertisement

glOrtho

Started by November 17, 2000 04:23 PM
2 comments, last by The Kid 24 years ago
Hey, I''ve looked around on the net a bit, and been coming up mostly empty handed. Does anyone have any information about orthographic projection using opengl ? Tutorials welcome, sample code welcome. Any help at all is welcome. Thanks alot for any help you could give. The Kid I don''''t know what the future holds, but I know who holds the future.
I don''t know what the future holds, but I know who holds the future.
to use the ortho projection, do like this in your render function:


glViewport(0, 0, 400, 400);//window size
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, 100, 0, 100, -1, 1);//how far does the coord go

glBegin(GL_POINTS);
glVertex2f(50, 50);
glEnd();

this should draw a point in the middle of the window

now you will draw in a ''2d world'' where you can draw with x and y values from 0 to 100 in both height and width.

hope this helps :^)

-Trond
Advertisement
Gracias mi amigo. Thanks alot. This will be ever so helpfull. Would it be to terribly much of a hassle for you to give me an email address at wich I can reach you, so that I can ask you directly about problems I will undoubtedly encounter ? Or not. Whatever happens. If anyone has any further information, that would be greatly helpful. my email address is galwyn@hotmail.com
Thanks a bunch all

The Kid

I don''''t know what the future holds, but I know who holds the future.
I don''t know what the future holds, but I know who holds the future.
Gracias mi amigo. Thanks alot. This will be ever so helpfull. Would it be to terribly much of a hassle for you to give me an email address at wich I can reach you, so that I can ask you directly about problems I will undoubtedly encounter ? Or not. Whatever happens. If anyone has any further information, that would be greatly helpful. my email address is galwyn@hotmail.com
Thanks a bunch all

The Kid

I don''''t know what the future holds, but I know who holds the future.
I don''t know what the future holds, but I know who holds the future.

This topic is closed to new replies.

Advertisement