glutSolidCube has anyone used this

i am trying to get this function to work on my windows machine i have other things that run and i am not sure what the deal is my display function looks like this

void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3d(1.0,0.5,1.0);
glutSolidCube(0.50);
glFlush();
glutSwapBuffers();

}

any help would be sweet

The problem can be anywhere in the code. Some not so uncommon problems is:

[ul][li] Forgetting to setup a viewpoint and a modelview matrix, ending up placing the entire model outside the view frustum.[] Forgetting to load the identity matrix before setting new viewpoint[] Using more than just a glTranslatef to place the object, and end up using them wrong, so the object is placed outside the frustum.[/ul][/li]
If this isn’t the problem, post the code which contains OpenGL related code (i.e. no input handling code and so on), and let us have a look.

void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1.0f,0.5f,1.0f);
glutSolidCube(0.50);
// glFlush();
glutSwapBuffers();
}

I havent been programming long, but it might be a problem with you calling glFlush() (for single buffering) then glSwapBuffers() (for double buffering). I think (and it makes sense) for you to pick one or the other.

glFinish() shouldn’t be the problem. glFinish() just waits for OpenGL to complete all commands passed to the pipeline. When it returns, you are sure that all commands that has been passed to the pipeline, is done. This command is only usefill in networked environements (where the command processor and the renderer is on different computers). This command doesn’t has anything to do with singlebuffered rendering. It’s working in the same way in doublebuffered rendering.

glutSolidCube draws a cube at the origin

before you draw translate back about 5

Also not that it really matters but make sure that GLUT_DOUBLE is passed to glutDisplayMode if you are going to use double buffering.

Also about the previous message, you should be able to move the camera 5 back by:

gluLookAt(eyex, eyey, 5, lookatx, lookaty, lookatz, dirupx, dirupy, dirupz)

In this case 5 is usally eyez.

cwhite40

just wanted to say thanks for the help i got it to work anyone wants to see just email me and i’ll send it not that it is that special

jwquinlin@yahoo.com