Sign in to follow this  

[.net] Drawing a sphere in Directx

This topic is 4812 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does ay one have a snippit that shows how to draw a sphere in Managed DirectX. I have been following Toms Book and Other links on the net but have as of yest not found out how to Draw a sphere and position it on a 3d Device. For the Example I need it in ether c# or VB.net, dosn't matter which one. Trying to position a sphere like DrawSpere(int xPos, int yPos, int zPos, int color) I will be loading the values from a XML File or Database Query Thanks in advance.

Share this post


Link to post
Share on other sites
You'll need more information than that to draw a sphere; at a minimum you need the radius of the sphere and its center.

Share this post


Link to post
Share on other sites
It involves painful (at least to my meager mind :P) math, and is pretty unnecessary wih Managed DirectX. Have you tried the Mesh.Sphere() method? Quite the timesaver. :)

Share this post


Link to post
Share on other sites
If you have been following Tom's book, he should have alot about using the premade mesh objects (like spheres, boxes, cylinders, and even teapots!).

Share this post


Link to post
Share on other sites
Thanks found it in chapter 5 but under Using Materials and lighting, Will do some more reading...

Share this post


Link to post
Share on other sites
Sign in to follow this