# Thread: How to draw a ball?

1. ## How to draw a ball?

I'm still new with Open GL, and I want to draw a ball.
Can anyone help me how to draw it? I can't even draw a circle using glVertex2f. Do i really have to make a loop to generate points of a circle and join them together?

Help...

2. ## Re: How to draw a ball?

Perhaps this will help...
http://nehe.gamedev.net/tutorials/lesson.asp?l=18

Also, Gametutorials.com has a quadrics tutorial. http://www.gametutorials.com/Tutoria...OpenGL_Pg2.htm

3. ## Re: How to draw a ball?

I just remembered that I cannot draw a ball using auxsphere... the code must be made from scratch sob

4. ## Re: How to draw a ball?

Its not that hard really, look into using quadric objects - they are really easy to understand

5. ## Re: How to draw a ball?

Can you use the function gluSphere or glutSolidSphere?

The only other way that is from scratch would be to build it from vertex's, if you do a search the code is here on this forum.
It has been asked in the past on building a sphere from scratch using sin/cos.

Originally posted by mushu:
I just remembered that I cannot draw a ball using auxsphere... the code must be made from scratch sob

[This message has been edited by nexusone (edited 05-06-2002).]

6. ## Re: How to draw a ball?

Thank you soo much I'll try to do what you say. and no, I can not use any built in method to draw the sphere... it's for an assignment... the teacher is really mean

7. ## Re: How to draw a ball?

just another question...
i found a site that has a code on how to draw a sphere.. if anyone can help me, can you tell me what is PID2 ? Looks like a constant, but I can't find it in math.h

Thanks beforehand

8. ## Re: How to draw a ball?

can you tell me what is PID2 ?
sounds like PI divided by 2
Code :
`PI / 2 = 1.5707963`
b

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•