Jump to content
  • Advertisement
Sign in to follow this  
Infinisearch

Spheres under perspective projection

This topic is 437 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

The main thing I want to accomplish is the quickest way to get a screen space bounding rect of a sphere.  If anyone knows a good fast method I would appreciate it.  But in addition I would like to know more about why a sphere under perspective projection isn't perfectly round?  More specifically I was looking at this: http://www.iquilezles.org/www/articles/sphereproj/sphereproj.htm page and in the first picture one of the spheres appear to tilted and was wondering what exactly causes that?

But like I said the primary thing I would like is a quick screen space bounding rect for a given sphere and a particular MVP matrix.

Edited by Infinisearch

Share this post


Link to post
Share on other sites
Advertisement
1 hour ago, Infinisearch said:

But in addition I would like to know more about why a sphere under perspective projection isn't perfectly round?

Same reason that the corners of a cube aren't right angles... Perspective distorts shapes.

iYgxKqC.png

It won't be minimal, but one easy way to get a bounding rect is to first make a 3D bounding box around the sphere, project all those corner points to 2D, and then use the 2D bounding box of those points.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!