Thread: sphere?

  1. #1
    Registered User planet_abhi's Avatar
    Join Date
    Oct 2002
    Posts
    92

    sphere?

    Anybodu knows how to draw a sphere in borland c++
    no opengl business
    AbHHinaay

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    simple trig

    1. you need the points of a circle......

    2. then you need to rotate the circle in stages, making polygons with each rotation.

    3. draw polygons
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    if this is for a game or any other type of real-time graphics system then I suggest generating trig tables for these purposes. This allows fast generation of things that require sin,cos calls
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    0<alpha<360
    -90<beta<90

    newx=centerx+((cos(alpha)*cos(beta))*radius)
    newy=centery+((cos(alpha)*sin(beta))*radius)
    newz=centerz+((sin(alpha))*radius)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What is wrong with my code?
    By dakarn in forum C Programming
    Replies: 6
    Last Post: 10-14-2008, 05:16 AM
  2. Lighting a Direct3D 9 mesh sphere
    By bennyandthejets in forum Game Programming
    Replies: 12
    Last Post: 02-14-2005, 01:19 AM
  3. Sphere code not working
    By VirtualAce in forum Game Programming
    Replies: 2
    Last Post: 10-03-2004, 07:29 AM
  4. Sphere backdrop problems
    By VirtualAce in forum Game Programming
    Replies: 26
    Last Post: 10-01-2004, 05:10 PM
  5. What am I doing wrong? Help please...
    By SprinterSteve in forum C Programming
    Replies: 9
    Last Post: 04-17-2003, 09:35 PM