Archived

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

Triangle strips

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