Jump to content
  • Advertisement
Sign in to follow this  
tre

Push and pop matrix question

This topic is 3295 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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!