Sign in to follow this  
Infinisearch

Spheres under perspective projection

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this