Sign in to follow this  

Only once

This topic is 4360 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Why does the Quad disappear after after the first frame? This is my display function (im using glut)... If i remove glClear it stays, but it only rotates on the first fram (i is increased every frame)
void display(void)
{
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();

	glPushMatrix();

	glRotatef(i, 0, 0, 1);
	glTranslatef(0,0,0);

	glBegin(GL_QUADS);
		glColor3f(1.0f, 0.0f, 0.0f);
		glTexCoord2f(0.0f, 0.0f);
		glVertex3f(0, 0, 0);
		glTexCoord2f(0.0f, 1.0f);
		glVertex3f(0, 1, 0);
		glTexCoord2f(1.0f, 1.0f);
		glVertex3f(1, 1, 0);
		glTexCoord2f(1.0f, 0.0f);
		glVertex3f(1, 0, 0);
	glEnd();

	glPopMatrix();

	glutSwapBuffers();
}

Share this post


Link to post
Share on other sites
runtime, its glut who handles the call to the function...
Everything works in the function but the drawing of the quad...

Share this post


Link to post
Share on other sites
backface culling is off

Only thing ive done with the projection matrix is:

glLoadIdentity();
gluPerspective(45.0f, static_cast<GLfloat>(width) / static_cast<float>(height), 0.1f, 100.0f);

Share this post


Link to post
Share on other sites
Problem solved...

after about 24h of thinking, and asking for helps in forums i now found that im drawing my quad to close to the camera... :(

I moved the quad to -1 in z-axis...

Share this post


Link to post
Share on other sites

This topic is 4360 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this