Sphere

Started by
2 comments, last by Striker47 21 years, 10 months ago
Hiho, how to draw a Sphere in OpenGl without(!) GLUT, just with some for or while loops? Thx4answer _________________ void signatur();
Advertisement
Look into the glu quadrics like gluSphere, gluCylinder, etc...
---I write code.DelphiGL (http://delphigl.cfxweb.net)
Try fooling around with sin() and cos() in a for statement. I can''t remember exactly how to do it, but it shouldnt be that hard to figure out on your own. The only hard part is connecting all the vertices together correctly
you can calculate points on sphere with:

x = radius*sin(a)*sin(b)
y = radius*cos(a)*sin(b)
z = radius*cos(b)

a [0..2PI]
b [-PI/2..PI/2]

then just connect the dots..


You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.

This topic is closed to new replies.

Advertisement