Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Budoken01

Weird Problem

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

First of all, I am trying to create a third person demo. I loaded a md2 model, and gave keyboard commands to it. However, when I try to include a polygon for any reason, it isnt showing up. Any help would be appreciated.
  
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();
	gluLookAt(0, 1.5f, 100,  0.0f, 0.5f, 0.0f,  0, 1, 0);
	glBegin(GL_QUADS);
		glVertex3f(-1.0f, 2.5f, 0.0f);
		glVertex3f(-1.0f, 2.5f, 0.0f);
		glVertex3f( 1.0f, 0.5f, 0.0f);
		glVertex3f( 1.0f, 0.5f, 0.0f);
	glEnd();
	Animate(&md2Model[0]);
	SwapBuffers(g_hDC);
  

Share this post


Link to post
Share on other sites
Advertisement
First off, you''re not actually drawing a quad with those vertex coordinates, you''re drawing a line.

Also, what''s your gluPerspective look like? You could be outside your viewing area...

Share this post


Link to post
Share on other sites
Oops, i meant:

  
glBegin(GL_QUADS);
glVertex3f(-1.0f, 2.5f, 0.0f);
glVertex3f( 1.0f, 2.5f, 0.0f);
glVertex3f( 1.0f, 0.5f, 0.0f);
glVertex3f(-1.0f, 0.5f, 0.0f);
glEnd();


and my perspective is:
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height, .5f ,150.0f);

Thanks.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
According to your gluLookAt(0, 1.5f, 100, 0.0f, 0.5f, 0.0f, 0, 1, 0); - you are standing at z=100, looking ABOVE you (for 0.5f), and drawing a quad IN FRONT of you (!) of course you won''t see anything!
Try the following:
gluLookAt(0, 1.5f, 100, 0.0f, 0.0f, 0.0f, -1, 0, 0);
^ ^
| |
see the difference?

Good luck!

Share this post


Link to post
Share on other sites

  • 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!