Results 1 to 3 of 3

Thread: How To Draw A Sphere?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2008
    Posts
    84

    How To Draw A Sphere?

    i want to write a game for which i need few sphere control, how can i write those plz help.... . . . . .

    i dont know how its done, but just need a way to do that

  2. #2
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: How To Draw A Sphere?

    Quote Originally Posted by -RaJ- View Post
    i want to write a game for which i need few sphere control, how can i write those plz help.... . . . . .

    i dont know how its done, but just need a way to do that
    As you probably know, the equation of a sphere in Cartesian coordinates is

    x2 + y2 + z2 = R2

    R being its radius.

    Do you want to draw the projection of a sphere on the screen? You should search the forum or the web for something like "3D graphics".
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  3. #3
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: How To Draw A Sphere?

    Well, it depends on how you want the sphere to look like.

    I think the fastest way it to have the sphere pre-drawn in a bitmap so that you just "copy & paste" it in your game.

    Another way is to simply draw a circle, and fill the colors in the circle to make it look like a sphere. I think there are algorithms out there that let you draw fake spheres...

    Another way is ray-tracing. This is the most accurate and it will look perfect, but it is also the slowest method. So since you said this is for a game, it is not really an option because it is way to slow for a game.

Posting Permissions

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



Click Here to Expand Forum to Full Width