
Questions about openGL
Hi, i am a beginner openGL programer,and i have the following problems:
1)i am rotating a triangle with the following code:
glRotatef(....
triangle1();
when i place a second triangle after the first, it rotates too.How can we prevent this happening????
2)Is there a way to align an object to the screen?For example put a font to the upper left corner?
3)Is there a camera we can use ?Or there is only the default???
thanks for your time!
Ironhell3

Hell World Game/3d EngineFind it at http://www.angelfire.com/on3/ironhell3index/HellWorld.html
store the current modelview matrix with...
"glPushMatrix();".
call your rotate and draw functions for the first triangle.
then restore the current modelview matrix with...
"glPopMatrix();".
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
"glPushMatrix();".
call your rotate and draw functions for the first triangle.
then restore the current modelview matrix with...
"glPopMatrix();".
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
1) Jenova got #1.
2) Yes. Setup an orthographic project matrix and set the dimensions to those of your window or the screen. Like this:
3) Think of the projection matrix as the "screen" matrix and the modelview matrix as the "camera" matrix. The modelview matrix (using glTranslate?, glRotate?, and glScale) is your camera.

2) Yes. Setup an orthographic project matrix and set the dimensions to those of your window or the screen. Like this:
|
3) Think of the projection matrix as the "screen" matrix and the modelview matrix as the "camera" matrix. The modelview matrix (using glTranslate?, glRotate?, and glScale) is your camera.

This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement