🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Calculating radius of projected sphere.

Started by
0 comments, last by Erik Rufelt 14 years, 11 months ago
Basically i cant figure out how to calculate radius of sphere projected onto screen. I use gluProject to get screen coords of projected sphere.
Advertisement
This was recently discussed in the following thread: http://www.gamedev.net/community/forums/topic.asp?topic_id=545204.

The projection of a sphere is not a perfect circle, and therefore does not have a single radius. An approximation should be radius * cot(fov / 2) / Z, where fov is the angle of the field of view, and Z is the z-distance to the sphere. This is in clip-space ([0, 1] on the screen), so it must be multiplied by your screen-size if you want it in pixels.

This topic is closed to new replies.

Advertisement