Jump to content
  • Advertisement

Archived

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

MARS_999

glVertex3f() issues?

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

If I put in actual float values insted of the float value thats is held in the array I get my triangle. If I use the code below I get nothing?

glColor3f(1.0f, 0.0f, 0.0f);
	glBegin(GL_TRIANGLES);
		glVertex3f(terrian[0], terrian[0], terrian[0]);
		glVertex3f(terrian[1], terrian[1], terrian[0]);
		glVertex3f(terrian[1], terrian[0], terrian[0]);		
	glEnd();
I don''t get it? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Have your program output what the values of terrian, either using some text output method you have or using a console window, but it seems that the data is probably being truncated or is not being written to for some reason. You need to place the ouput call immedietly before or after the glVertex3f call to find out for sure though.

Share this post


Link to post
Share on other sites
1. is the triangle in the view frustum?

2. maybe you wrote
float terrian[2] = {5, 2};

3. try glArrayElement

4. keeps your machine allocating memory all the time your program is running? if so you''ve forgotten glEndList();

5. do glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);

6. swap the buffers

...
it''s a bit of low information given by you o_O

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!