22
$\begingroup$

My intuition has always been that when any sphere is projected into 2D space that the result will always mathematically be an ellipse (or a circle in degenerate cases).

In the past when I was actively doing my own graphics programming and brought this up with other people they were adamant that I was wrong. If I recall correctly they believed the result could be something vaguely "egg shaped".

Who was correct?


Since there is already one answer submitted, I don't wish to totally change my question but I realize I left out important details due to losing familiarity with the field over the years.

I intended to ask specifically about perspective projection where the projection is a linear application.

The other projections are of course interesting for many uses so I wouldn't want them removed at this point. But it would be great if answers could have perspective projection as their most prominent section.

$\endgroup$
  • 3
    $\begingroup$ Assuming a perspective projection, AFAICS the 'boundary' formed by the view-points horizon will be a (truncated) cone and thus most of the projection will be a conic section: en.wikipedia.org/wiki/Conic_section. An ellipse is thus a possibility, but not the only one. $\endgroup$ – Simon F Sep 15 '15 at 12:27
  • 1
    $\begingroup$ In that case I will promote my comments to an answer... $\endgroup$ – Simon F Sep 15 '15 at 15:06
  • 1
    $\begingroup$ you need to add a constraint. fisheye is also a perspective projection, and you won't get ellipses. the constraint you need is linearity. $\endgroup$ – v.oddou Sep 16 '15 at 1:16
  • 1
    $\begingroup$ I would rather say something like "where the projection is a linear application". There might be some shortcut term for this, like "linear epimorphism" or something, but I long forgot that. $\endgroup$ – v.oddou Sep 16 '15 at 6:14
  • 1
    $\begingroup$ This should go somewhere in this thread, so adding it here :) Inigo Quilez's analytic sphere projection: shadertoy.com/view/XdBGzd $\endgroup$ – Mikkel Gjoel Feb 2 '16 at 12:11
18
$\begingroup$

Assuming a perspective projection and a view point external to the sphere, then the 'boundary' formed by the view point and the circle on the sphere which forms the horizon WRT the view point, will be a cone.

Doing a perspective projection (onto a plane) is then equivalent to intersecting this cone with the plane which thus produces a conic section. FYI the four, non-degenerate, cases are shown in this image from Wikipedia enter image description here

An ellipse/circle is thus a possibility, but not the only one - unbounded parabolas or hyperbolas (and I guess if the plane passes through the eye, even degenerate cases ) are possible.

$\endgroup$
  • 1
    $\begingroup$ I'm unable to imagine how the result could be a parabola or hyperbola despite the absolute logic of your argument. Some words clarifying what kind of layout would lead to these would be great. The best I can get my brain around is "something to do with infinities somehow" ... $\endgroup$ – hippietrail Sep 15 '15 at 15:27
  • 3
    $\begingroup$ Maybe something equivalent might help. Imagine you are holding a torch (flashlight for those in North America), which makes a conic beam, and you are in in a dark empty (infinite) warehouse. Shining the torch at the floor you see an ellipse. Now gradually tilt the axis of the torch back towards the horizontal. The ellipse will get longer and longer until the point when the topmost 'edge' of the beam itself is horizontal, i.e. parallel to the floor. Now the projection is a parabola and it stretches on forever. Tilting it further will form a hyperbola. $\endgroup$ – Simon F Sep 15 '15 at 15:42
  • 1
    $\begingroup$ @hippietrail: It's perhaps worth noting that, with a view plane in front of the camera, the only way you can end up with a parabola or a hyperbola is if at least part of the sphere is between the focal point and the view plane. $\endgroup$ – Ilmari Karonen Sep 15 '15 at 22:43
  • $\begingroup$ @IlmariKaronen: What would "focal point" mean in this context? The point the eye is focussing on? The vanishing point? (I taught myself 3D perspective rotation and projection as a 12 or 13 year old and never gained fluency in the math and terminology.) $\endgroup$ – hippietrail Sep 19 '15 at 4:47
  • $\begingroup$ @hippietrail Focal point, in this context, would be the apex of the cone. Effectively the "pinhole" of the perspective, pinhole camera model. (PS Does the name imply meeting "a strange lady. She made me nervous.."?) $\endgroup$ – Simon F Sep 21 '15 at 7:49
14
$\begingroup$

This is more like a long comment to @SimonF's answer that I'm trying to make somewhat self contained.

All cuts of cone are possible, hyperbola, parabola and ovals. This is easy to test by drawing images in a 3D engine by a extremely wide angle camera. Rotate the camera to say in 30 degree angle so the object is not in the middle of your focus. Then gradually move the camera closer to the sphere.

enter image description here

Image 1: Flying very close to a sphere looking slightly sideways. Notice how we suddenly puncture the surface form inside.

So to recap when the sphere is very close so it exits the picture in wide image it can be a parabola or hyperbola. But the shape will just exit the frame to do so.

$\endgroup$
  • 1
    $\begingroup$ What might be really nice is if your animation could change the shading for the various outcomes: Say white for ellipse, green (for the 'one frame' of parabola), and red for hyperbola. :-) $\endgroup$ – Simon F Sep 16 '15 at 8:42
  • 2
    $\begingroup$ @SimonF i thought about this, i was planning something like nathan reed. But i was in a bit of hurry, i was lucky to get this render done. Initially i was a bit sceptical whether hyperbola could exist at all, but yes now it seems obvious. $\endgroup$ – joojaa Sep 16 '15 at 9:08
13
$\begingroup$

Projection systems are used to convert a 3D shape to a planar (2D) shape.

According to the type of projection system, different results and shapes like rectangles, pies, ellipses, circles, ... can be produced out of a sphere.

Projection systems can be classified by the characteristics of the result they generate.

To continue, I would like to use a very touchable and common example that we have all seen before, Earth sphere and global wide maps, they are everywhere.

Suppose your sphere is the earth!

Imagine the earth as your sphere and a planar world map that is created from the spherical shape of the earth. In most of the world maps you see the countries near to the poles are getting much bigger than they are in reality, like Iceland which is 1/14 of Africa continent in reality but the map shows them both as equal. This is because when we are omitting one dimension we loose one characteristic of our shapes.

Different projection systems and their results

This is a planar projection which doesn't conserve distance, angles or area. The red circles show the amount of exaggeration that is the product of this projection.

First

Equal-Area, look at Iceland and Africa in this one and compare with above.

Second

Projection systems can be classified by what they preserve.

  1. Equal area.
  2. Equal angle which preserve the shape without distortion (conformal).
  3. Equal distance.
  4. ......

Conformal projections preserve the shapes but area will not be preserved (the first above picture) this one is the most famous projection system that is used in many applications. Your sphere is a rectangle here!


So you cannot say a sphere will be projected to an ellipse always. As mentioned above a sphere can be projected to a rectangle (first shape) or can be an ellipse but with different characteristics (equal angle, distance, shape, area - see the following picture), or you may also project a sphere into a conic and then open the conic so you will have a pie.

Each of the above projection systems can be applied with iterative or direct algorithms that can be found on the internet. I didn't talk about the formula and transformations because you didn't ask. Although I wish you to find this answer useful.

Third


In perspective projections I say yes only ellipses will be produced out of spheres

Cutting a conic with a horizontal plane creates a circle.

Cutting with an oblique plane creates a bevel which would be an ellipse or a hyperbola depending on the cutting angle, and when this angle inclines to be vertical in will create a parabola (following picture).

Ellipse

Maybe this is obvious but take a look at their equations.

For simplicity I assumed all geometries are origin centered.

Equations:

Circle: $x^2+y^2=r^2$

Ellipse: $x^2/a^2+y^2/b^2=1$

Hyperbola: $x^2/a^2-y^2/b^2=1$

Parabola: $y^2=4ax$

Morphology :

An ellipse has two foci obviously. A circle as a special kind of ellipsis has two foci too but they are coincident. A hyperbola however is a y axis mirror of its equal ellipsis and it has two foci too. A parabola has one focus but actually it has two because the second one is at infinity: when the cutting plane inclines to 90 degrees (bearing angle), second focus goes to infinity.

Conclusion

As you see all are ellipses, however you may name them differently to describe special cases, but if you are going to implement it in a game, you need to assume an ellipse equation and it is enough. I can't tell which one of you guys are right, you or your friend, because both could be right.

$\endgroup$
  • 2
    $\begingroup$ Thanks for your answer. Please see my addenda about perspective projection. Apologies for this oversight in my original wording. $\endgroup$ – hippietrail Sep 15 '15 at 15:28
  • 2
    $\begingroup$ Yes I tried to cover that in my original question. Points and line segments are other degenerate ellipses too I believe. $\endgroup$ – hippietrail Sep 15 '15 at 17:27
  • 3
    $\begingroup$ @hippietrail: The Earth is actually an excellent example also for perspective projections. If you take an ordinary photograph outdoors, pointing the camera towards the horizon, then (assuming that your lens has no distortion, and that the Earth is approximately a perfect sphere) the image of the Earth in the picture will be (a section of) a very broad hyperbola. $\endgroup$ – Ilmari Karonen Sep 15 '15 at 22:53
  • 1
    $\begingroup$ @IlmariKaronen: Wow that makes it super clear and is worthy of an answer of its own! Would there be a version of this that would result in a parabola? $\endgroup$ – hippietrail Sep 16 '15 at 5:20
  • 1
    $\begingroup$ @hippietrail I add some explanation at the end of my answer, hope it could answer new aspects of edited question. and thanks for your complement. $\endgroup$ – Zich Sep 16 '15 at 10:41
11
$\begingroup$

SimonF's reasoning basically convinced me, but I decided to do a sanity check. I loaded up a UE4 level that happens to have some spheres, like this one:

enter image description here

I set the camera FOV up to 160 degrees to give lots of perspective distortion, and positioned it so the sphere was near the corner of the image:

enter image description here

Then I took this into Inkscape and used the ellipse tool to draw on it:

enter image description here

Surprise! It's a perfect fit!

$\endgroup$
  • 1
    $\begingroup$ Very prettily illustrative! What do you think about tackling the parabola and hyperbola cases? $\endgroup$ – hippietrail Sep 15 '15 at 20:47
  • 2
    $\begingroup$ @hippietrail Unfortunately, vector art programs don't have parabola and hyperbola tools the way they have ellipse tools, so it would be a bit harder... :) $\endgroup$ – Nathan Reed Sep 15 '15 at 22:00
  • $\begingroup$ @NathanReed sure but they do have general graphing tools, (if not you can get one from me) graph a generic parabola and scale/rotate to fit. $\endgroup$ – joojaa Sep 16 '15 at 9:11
0
$\begingroup$

There are no parabolas or hyperbolas formed when slicing a sphere once. There are no ellipses either except for the special case which is a circle.The result is always a circle. If you project the sphere onto a tilted plane you get an ellipse

$\endgroup$
  • 1
    $\begingroup$ The other answers indicate that shapes other than an ellipse are possible. Can you demonstrate why they may be incorrect? $\endgroup$ – Simon F Apr 11 '18 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.