Jump to content
  • Advertisement


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


Triangle strips

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

What''s wrong with the following code for drawing two triangles using triangle strips?
GLfloat vertices[] = {
	0.0f, 0.0f, 0.0f,
	1.0f, 0.0f, 0.0f,
	0.0f, 1.0f, 0.0f,
	1.0f, 1.0f, 0.0f

GLuint indices[] = {
	0, 6, 3, 9

glVertexPointer(3, GL_FLOAT, 0, &vertices);
glDrawElements(GL_TRIANGLE_STRIP, 2, GL_UNSIGNED_INT, &indices);

Share this post

Link to post
Share on other sites
I may be wrong but I''m fairly sure that indices reference vertices
not vertex components (i.e. you should have 0, 2, 1, 3 for your
indices instead of 0, 6, 3, 9).


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!