|
-
Apr 2nd, 2009, 12:46 AM
#1
Thread Starter
Lively Member
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
-
Apr 2nd, 2009, 05:01 AM
#2
Re: How To Draw A Sphere?
 Originally Posted by -RaJ-
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)
-
Apr 2nd, 2009, 07:46 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|