Rotating triangle strips

Started by
1 comment, last by Trienco 15 years, 9 months ago
Hi Everyone I've created a hemisphere which will be in the end a sky dome. However once I've generated the points and generated the sphere (no textures as yet), it needs rotating so it's in the correct position (it's on its side at the moment). I'm not fully sure how to do this and have had a few goes at it using glRotate but having no look. The following code segment draws up the points to make the hemisphere: glBegin(GL_TRIANGLE_STRIP); for(int i = 0; i != NumVertices; i++) { glVertex3f(Vertices.x, Vertices.y, Vertices.z); } glEnd(); I know I'll need to use glRotate3f but I'm not sure how in this situation. Any help appreciated. Thank you in advance. Andrew
Advertisement
glRotetef takes 4 floats, first for the amount of rotation, and 3 others to determine around what it should rotate.

glRotatef(xRotation,1.0f,0.0f,0.0f);
glRotatef(yRotation,0.0f,1.0f,0.0f);
glRotatef(zRotation,0.0f,0.0f,1.0f);

there, examble on how to rotate around x, y, and z axels.
And because the question itself hints at some misunderstandings: you have to call glRotate BEFORE you draw the strip... or any other kind of whatever it is you want to rotate. Doesn't matter if it's a triangle, a strip or a complex model consisting of 20 seperate parts.
f@dzhttp://festini.device-zero.de

This topic is closed to new replies.

Advertisement