sphere?

This is a discussion on sphere? within the Game Programming forums, part of the General Programming Boards category; Anybodu knows how to draw a sphere in borland c++ no opengl business...

  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
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    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, 06: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, 08:29 AM
  4. Sphere backdrop problems
    By VirtualAce in forum Game Programming
    Replies: 26
    Last Post: 10-01-2004, 06:10 PM
  5. What am I doing wrong? Help please...
    By SprinterSteve in forum C Programming
    Replies: 9
    Last Post: 04-17-2003, 10:35 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21