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


How to create a sphere?

Recommended Posts

jlebrech    116
Red Book page 88,

Links to code from red book

or try and search for code.

Or another method would be to draw circle at different angles

Here some code off my head.

z = 0;

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

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


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