A bizarre 3D projection in 2D for a sphere

625 Views Asked by At

Projection picture: https://i.stack.imgur.com/YENxg.png

I want to project a point with coordinates (x,y,z) sitting on/inside a sphere to 2D coordinates on the screen according to the projection shown in the image. I originally thought this was something similar to cabinet projection, however when doing that, the ellipses representing circles on each plane were tilted.

It seems like the scaling for the depth axis changes with the distance from the origin of the coordinate system, but I'm not sure how.

How may I project a point in this way? (the point will never go outside the sphere)

2

There are 2 best solutions below

1
On BEST ANSWER

For simplicity, I'll use $(x, y, z)$ for the three-dimensional coordinates, and $(u, v)$ as the projected coordinates, with both coordinate systems having origin at the center of the picture, $u$ increasing right, and $v$ up.

$y z$ plane seems to correspond to $u v$ plane, but the projected unit $x$ axis vector varies rather oddly. You see, if you draw the square $(1,0,1)$-$(1,0,-1)$-$(-1,0,-1)$-$(-1,0,1)$-$(1,0,1)$, it will be a parallelogram, with top and bottom edges horizontal, but sides tangent to the tall ellipse at the intersection of the two ellipses. The positive $x z$ quadrant has the same area as the negative $x z$ quadrant in the projection!

Let's look at where each of the points $x, y, z \in -1, 0, +1$ project to. $$\begin{array}{ccc|cc|l} x & y & z & u & v & \text{Comments} \\ \hline -1 & -1 & -1 & -1 & -1 & ~ \\ -1 & -1 & 0 & -1 & +c & ~ \\ -1 & -1 & +1 & -1 & +1 & ~ \\ -1 & 0 & -1 & +c & -1 & ~ \\ -1 & 0 & 0 & +b & +b & ~ \\ -1 & 0 & +1 & +a & +1 & ~ \\ -1 & +1 & -1 & +1 & -1 & ~ \\ -1 & +1 & 0 & +1 & +a & ~ \\ -1 & +1 & +1 & +1 & +1 & ~ \\ 0 & -1 & -1 & -1 & -1 & ~ \\ 0 & -1 & 0 & -1 & 0 & ~ \\ 0 & -1 & +1 & -1 & +1 & ~ \\ 0 & 0 & -1 & 0 & -1 & ~ \\ 0 & 0 & 0 & 0 & 0 & ~ \\ 0 & 0 & +1 & 0 & +1 & ~ \\ 0 & +1 & -1 & +1 & -1 & ~ \\ 0 & +1 & 0 & +1 & 0 & ~ \\ 0 & +1 & +1 & +1 & +1 & ~ \\ +1 & -1 & -1 & -1 & -1 & ~ \\ +1 & -1 & 0 & -1 & -a & ~ \\ +1 & -1 & +1 & -1 & +1 & ~ \\ +1 & 0 & -1 & -a & -1 & ~ \\ +1 & 0 & 0 & -b & -b & ~ \\ +1 & 0 & +1 & -c & +1 & ~ \\ +1 & +1 & -1 & +1 & -1 & ~ \\ +1 & +1 & 0 & +1 & -c & ~ \\ +1 & +1 & +1 & +1 & +1 & ~ \\ \end{array}$$ This has one possible solution, $$\left\lbrace\begin{aligned} u(x, y, z) & = ~ y - b x + x z^2 (2 b - c - a) / 2 \\ ~ & + ~ x y^2 b + x y^2 z^2 (c + a - 2 b) / 2 \\ ~ & + ~ x^2 z^2 (a - c) / 2 + x^2 y^2 z (c - a) / 2 \\ v(x, y, z) & = ~ z + b x ( z^2 - 1 ) + \\ ~ & + x y^2 (c + a - 2 b)(z^2 - 1) / 2 \\ ~ & + x^2 y (c - a)(z^2 - 1) / 2 \\ \end{aligned}\right.$$

In order for the $(\pm 1, 0, 0)$ to be properly tangential to the ellipses, we need $$c - a = \frac{2 r b}{\sqrt{1 - b^2}}$$ where $r$ is the width and height of the ellipses; to keep linearity, we need $$a (1 + b) + c (1 - b) = 2 b$$ Combining these, we find that for reasonable $0 \lt b \lt r \lt 1$, $$\left\lbrace ~ \begin{aligned} \displaystyle a &= b - \frac{b r \sqrt{1 - b^2}}{b + 1} \\ \displaystyle c &= b - \frac{b r \sqrt{1 - b^2}}{b - 1} \\ \end{aligned} \right.$$ with $0 \lt a \lt b \lt r \lt c \lt 1$. The image suggests $r \approx 0.302$ and $b \approx 0.289$, which yield $a \approx 0.224$, $c \approx 0.406$, so that the mapping/projection is $$\left\lbrace ~ \begin{aligned} u(x, y, z) &= y - 0.289 x ( 1 - y^2 ) - 0.091 x^2 z (1 - y^2 ) - 0.026 x z^2 (1 - y^2 ) \\ v(x, y, z) &= z + 0.289 x (z^2 - 1) + 0.091 x^2 y (z^2 - 1) + 0.026 x y^2 (z^2 - 1) \\ \end{aligned} \right.$$

This mapping replicates the observed features, but it for sure isn't a normal 3D projection; it is some kind of transformation to odd curvilinear coordinate system...

The reason for this image, by the way, is simplicity: it is "sufficiently close" to a projection for humans to roughly understand it – we tolerate surprisingly large errors (on the order of 10% to 25%) and still "perceive" it, approximately.

3
On

Since $y$ and $z$ are aligned to the axes, they will be mapped at a 1-1 relationship. They leaves what to with $x$. There are 2 angles that are relevant; one is the angle that $x$ makes with the x-axis on the screen, which I will call $\theta$, and the other is the angle that the axis makes with the screen, which I will call $\phi$. For example, if $\phi$ is perpendicular to the screen, the $x-$coordinate will be completely suppressed. Looking at the picture, and picking appropriate trig functions yields the transformation: $$(x,y,z) \rightarrow (y-x\cos{\theta}\sin{\phi},z+x\sin{\theta}\sin{\phi})$$