I have what I’m sure is a simple question about clipping when trying to draw to screen. I am trying to draw a cube in the center of the screen. I know that I have the correct vertices being fed into the glVertex3dv command.
My picture looks like something like this: Here
As you can see, some of these vertices are not showing up correctly. Also, I’d like to know how I can always have the cube appear in the center of the screen. So I can zoom out/in etc.
display(void){
glClear(GL_COLOR_BUFFER_BIT);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0.0, 0.0, 1.0, centroid_x, centroid_y, centroid_z, 0.0, 1.0, 0.0);
/*Insert vertex coordinates using glVertex3dv*/
glutSwapBuffers();
}
Like I said, I’m looking for a way to use the gluLookAt command to always have the object front and center in the window and how to stop clipping from happening. Thanks for any help you all may provide!