The second code block I posted works. Did you TRY it?
I posted a working code, it just draws the points, I need faces drawn. I don't know how to define the faces. I had assumed that somebody could make the jump from drawn vertices to drawn faces.
Here is a complete program showing it.
I posted a working code, it just draws the points, I need faces drawn. I don't know how to define the faces. I had assumed that somebody could make the jump from drawn vertices to drawn faces.
Here is a complete program showing it.
Strict GLGraphics 640,480 glEnable GL_DEPTH_TEST 'Enables Depth Testing glMatrixMode GL_PROJECTION 'Select The Projection Matrix glLoadIdentity 'Reset The Projection Matrix glOrtho(0,640,480,0,-1000,1000) 'Setup The Projection Matrix Frustum glMatrixMode GL_MODELVIEW 'Select The ModelView Matrix glLoadIdentity 'Reset The ModelView Matrix Function draw_sphere(x#,y#,z#,x_divisions#,y_divisions#,radius#) Local sub#=180/y_divisions Local sub2#=360/x_divisions Local base=0 For Local a#=0 To x_divisions glLoadIdentity() glTranslatef x,y,z glRotatef a*sub2,0,1,0 glBegin GL_points For Local i#=0 To y_divisions ' first point Local POINT_X#=Cos((i*sub)-90)*radius Local POINT_Y#=Sin((i*sub)-90)*radius glColor3f 1,1,1 ' draw points glVertex3f POINT_X,POINT_Y,0 Next glEnd Next End Function While Not KeyHit( KEY_ESCAPE ) glClear GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT 'Clear The Screen And The Depth Buffer draw_sphere(320,240,0,20,20,100) Flip Wend