Advertisement

Really simple problem. I could solve it if the search function worked :P

Started by May 05, 2005 10:43 PM
1 comment, last by MalcolmOSX 19 years, 4 months ago
Hey guys...long time programmer but newcomer to OpenGL. I have been following NeHe's tutorials...but I noticed something odd when programming with Dev-C++ (the only IDE I can try at the moment) and when I try the glTranslatef(1.0f, 0.0f, -6.0f); Nothing would get drawn. After some experimentation I found out that if I put anything greater then 1.0f or -1.0f nothing will get drawn. I know that this is a newbie question but...I cannot seem to get the forum search engine working. Any help would be much appreciated :)
Maybe your back clip plane is set too close. Set the clip plane positions like so:

glMatrixMode(GL_PROJECTION);glLoadIdentity();gluPerspective(yourFOV, //field of viewyourAspectRatio, //aspect ratiozNear, //the near clip plane, this is the point at which graphics too close to the camera will be cut offzFar, //this is the point at which polygons too far from the camera will be cut off};


Hope that helps. For most newbies, a value of 1.0 for near and 100.0 for far is generally good. There are some issues with the depth buffer and the ratio between your near and far clip planes, but you don't have to worry about that yet.
Advertisement
Aah. Problem solved. Someone (the monkey in my closet, I believe) somehow switched the two numbers. I appreciate the help :)

This topic is closed to new replies.

Advertisement