Jump to content
  • Advertisement
Sign in to follow this  
tre

Push and pop matrix question

This topic is 3205 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

Hi, could anyone explain to me why the below code won't render the sphere?
void Draw(void){
	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();
	Lighting();
	
	initShader();
		glPushMatrix();
			glTranslatef (0.0f, 0.0f, -10.0f);
			glutSolidTeapot(1);
		glPopMatrix();

		glPushMatrix();
			glTranslatef (-2.0f, -2.0f, 0.0f);
			glutSolidSphere(1, 10, 10);
		glPopMatrix();
	deinitShader();
}

What am I not getting with the Push and Pop Matrix calls? Thanks! Marcus

Share this post


Link to post
Share on other sites
Advertisement
The sphere is probably too close. What is your projection matrix?

Try to:
glTranslatef(-2.0f, -2.0f, -10.0f); with the sphere.

If it doesn't work, than it's not a projection issue.

Share this post


Link to post
Share on other sites
Quote:
Original post by szecs
The sphere is probably too close. What is your projection matrix?

Try to:
glTranslatef(-2.0f, -2.0f, -10.0f); with the sphere.

If it doesn't work, than it's not a projection issue.


Haha, man, do I feel stupid :)
I guess I'm going programming blind here.
Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!