PDA

View Full Version : glutSolidCube has anyone used this



buddylee
09-20-2000, 05:29 PM
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

Bob
09-21-2000, 02:20 AM
The problem can be anywhere in the code. Some not so uncommon problems is:

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.

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.

mist350
09-22-2000, 01:57 AM
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.

Bob
09-22-2000, 02:25 AM
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.

09-22-2000, 06:43 AM
glutSolidCube draws a cube at the origin

before you draw translate back about 5

cwhite40
09-23-2000, 01:11 PM
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.

http://www.opengl.org/discussion_boards/ubb/eek.gif cwhite40 http://www.opengl.org/discussion_boards/ubb/eek.gif

buddylee
09-24-2000, 09:18 AM
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