Results 1 to 8 of 8

Thread: How to draw a ball?

  1. #1
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    4

    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. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Fort Collins, Colorado
    Posts
    446

    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. #3
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    4

    Re: How to draw a ball?

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

  4. #4
    Member Contributor
    Join Date
    Jan 2002
    Posts
    96

    Re: How to draw a ball?

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

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    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:
    thanks for the link
    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. #6
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    4

    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. #7
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    4

    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

    btw, here's the address http://astronomy.swin.edu.au/~pbourke/opengl/sphere/

    Thanks beforehand

  8. #8
    Senior Member Regular Contributor
    Join Date
    Mar 2001
    Posts
    184

    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

Similar Threads

  1. Ball to Ball Collisions
    By elasolova in forum OpenGL: General
    Replies: 3
    Last Post: 07-29-2010, 09:58 PM
  2. bouncing ball
    By skinx in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 08-06-2005, 09:48 AM
  3. draw a ball
    By kuh in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-09-2005, 05:36 AM
  4. Eight ball
    By Eclipix in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 05-08-2002, 12:51 PM
  5. Draw ball......
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-24-2000, 09:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean