I was wondering if anyone had some code to draw a circle in DirectX 9?
I searched on google for a while, and all i could find was a function to draw a sphere
Any help would be appreciated..
I was wondering if anyone had some code to draw a circle in DirectX 9?
I searched on google for a while, and all i could find was a function to draw a sphere
Any help would be appreciated..
Triangle Fans make this very easy. If you are not familiar with how they work, read the following link:
http://msdn.microsoft.com/archive/de...ianglefans.asp
It should be pretty obvious that you can just create points using sine and consine to make your circle. The more points you have the more the quality will improve. Remeber about the quality / performance trade off. The center of the triangle fan is your circle center. Hope this helps you.
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers
You should also note to that multiple layers of downward pointing triangle fans produce very nice models for pine trees. The triangle fans will be extremely fast since only one vertex per tri is needed.
thanks, ill try that out tonight, but i was wondering, can you set a texture for a circle? and how?
Do you mean texture the triangle fan representing the circle? Or do you mean use a texture of a circle. If you are talking about the latter, then look into billboarding and set the texture you want as the billboards texture with alpha transparency.
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers
well, basically, im trying to make a 3d clock... so i was wondering, would it be better to use a textured quad or a textured circle for the clockface?