Archived

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

TheVoid

How to create a sphere?

Recommended Posts

jlebrech    116
Red Book page 88,

Links to code from red book ftp://sgigate.sgi.com/pub/opengl/opengl12.zip

or try sgi.com and search for code.


Or another method would be to draw circle at different angles

Here some code off my head.


z = 0;

glBegin(GL_TRIANGLES);
for (radian = 0; radian > PI*2; radian = radian + PI /180){

x = sin(radian) * centerx;
y = cos(radian) * centerY;
glVertex3fv( x, y, z);


}
glEnd();


use glRotate after each circle to rotate and at Z angle.

I would stick to the red book if I was you.

[edited by - jlebrech on October 21, 2002 2:24:54 PM]

Share this post


Link to post
Share on other sites