PDA

View Full Version : gluPerspective()/glRotatef()



ryacketta
05-28-2002, 05:30 PM
Folks,

I am a true "OpenGL coding: beginner", been following several threads and even mucking with some tutorials on NeHe.

I was wondering if someone can shed some light on eliminating the "flipping" of images with gluPerspective/glRoatef etc..

if I do the following

gluPerspective(45.0f+f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
f += 0.1f;

my image will go away from me, then "flip" and come from behind me then away again.

that is

I make a triangle with a quad next to it, as it goes down the Z axis the triangle is on the left and the quad is on the right. Once the image is gone, it will flip (quad on the left and traingle on the right) and come from behind me (per say) into the screen.

This happens with textures as well, if I rotate an image the texture gets flipped (upside down etc.)

Yes, you guesed it I am a newbie!

-Ron

Tone
05-28-2002, 06:19 PM
The variable that you are changing represents the field of view of the camera. Once that value passes 180 everything will become flipped. If you are trying to zoom in and out of the scene you want to keep the field of view between 0 and 180. Hope that helps.

Tone