About ways to see three-dimensional images on the monitor screen

ZXNet echo conference «zx.spectrum»

From Andrew Savichev To All 21 February 1998


Hi, All!

We once touched upon the problems of volumetric perception, but then we were talking about
stereo video. But people in another echo are also interested in pseudo-stereo.
Because. I know that this message will also be read by people from ZX-NET, so I strongly
recommend teasing their nodes and subscribing to the SU.GRAPHICS echo, an excerpt
from the FAQ of which, dedicated to SUBJ, I present here.

-----------
SU.GRAPHICS Frequently Asked Questions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Issue 1.
Date: 18 Feb 1998.

[skip]

If you want to add to the FAQ or suggest something, write:

Alexey A. Monastyrenko,

2:5030/168.26@fidonet
2:5030/303.8@fidonet
2:5030/304.8@fidonet
mon...@magnit.spb.ru

FAQ will be posted on http://members.tripod.com/~almonster
and fast in the echo SU.GRAPHICS.
^^^^^^^^^^^


0. Preface.┼
²²²²²²²²²²²²²²²▄

First, a little about the terminology that I will use here.
As a rule, we will be talking about raster images - either RGB,
either with a palette, or black and white - greyscale.
For RGBimages:
R[x,y], G[x,y], B[x,y] - three components (red, green, blue) of color
pixel with coordinates (x,y).
╙ ▐
┐ R[x,y] ┐
C[x,y] = ┐ G[x,y] ┐
┐ B[x,y] ┐
░ ╘

For images with a palette:
C[x,y] - index in the color palette of the pixel with coordinates (x,y).

For black and white:
C[x,y]=I[x,y] - brightness of the pixel with coordinates (x,y).

If square brackets with coordinates are not specified, we are talking about the current point.

[skip]


6.1. Red-blue glasses.┼
²²²²²²²²²²²²²²²²²²²²²²²▄

Black and white images of the scene are constructed from two points of view -
from the left eye and from the right eye.
Next, for each point of the screen, an image is taken color

R[x,y]=Left[x,y] {picture for the left eye}
G[x,y]=0
B[x,y]=Right[x,y] {picture for the right eye}

When working in 256-color video mode, each component produces
16 gradations. This is quite enough to construct a more or less realistic image.

The user wears special glasses: a blue filter on the left eye and a red filter on the right.

The disadvantage of the method is that the image is black and white (more precisely, black and purple).


6.2. Polaroid glasses.┼
²²²²²²²²²²²²²²²²²²²²²²▄

This method produces a full color three-dimensional image.
Unfortunately, it requires 2 projectors and, as a result,
it is difficult to dodynamically changing (unless, of course, you have
an extra pair of movie cameras :-) ).

In general, images for two eyes are calculated, after which
each of them is transferred to a slide. Two slides are projected
by two projectors onto a common screen, but the light from each projector
is passed through a polarizer (for example, Polaroid film
from a liquid crystal display). The polarization planes for
projectors are perpendicular (for example, on the left it is vertical, on the
right it is horizontal).
The user wears glasses made of two polarizers, the polarization planes of which coincide with the polarization planes of the projectors.

The image was made by Bohdan Afanasjev, 2:463/416.13.


6.3 using this scheme. 'Magic Eye' - hidden pictures.┼
²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²²▄

Pictures on which at first glance there is only some kind of ornament,
but if you peer with a cunning eye (looking through it into infinity),
you can see three-dimensional figures.
Advantages - no additional equipment is needed.
Disadvantages - reflects only the shape, color and even brightness are lost.


--------+--------▐
X - - - -▒ z
/ \
/ \
/ \
----/-------\---- screen plane
/ \
/ \
/ \
() eyes ()


+ - origin of coordinates, z axis - down, x axis - right
X - pointobject

Coordinates of the eyes: (-b/2,L) - left, (b/2,L) - right.
(L - distance from the eyes to the picture plane - i.e. where z=0)

Intersection points of the 'rays from the eyes' with the screen:
z_l = z_r = h (h - from the screen to the background picture)
x_l = x - (x - x_l_eye)*(h-z)/(L-z) (1)
x_r = x - (x - x_r_eye)*(h-z)/(L-z) (2)

Here. And, accordingly, the colors of the points with coordinates x_l and x_r should
match - or correspond, but then it will be shiny and difficult to
match.

Direct calculations using formulas (1), (2) are carried out at a decent (e.g. for
animation) speed is unrealistic.

And now simplifications:
1. Let z<x_l ~= x - (x - x_l_eye)*C + (x - x_l_eye)*(z/h-z/L)
= x*(1-C) + x_l_eye*C + (x - x_l_eye)*z/H (1a)

1/H = 1/h - 1/L
H=h*L/(L-h)=h/(1-C); H ~ h

x_r ~= x*(1-C) + x_r_eye*C +(x-x_r_eye)*z/H (2a)

x_r-x_l = b*C - b*z/H (3)

(x_r+x_l)/2 = x*(1-C) + x*z/H (4)

By the way, the vertical coordinate on screen

y_r = y_l = y*(1-C) - this is the exact expression.

2. Let's define x through x_r (the formula is asymmetrical, but the calculation is fast - because it will cycle through the displayed points).

Because z<x_r = x*(1-C) + x_l_eye*C, from which
x*(1-C) = (x_r - x_r_eye*C) (5)

Instead of x,y,z it is more convenient to work with x*(1-C), y*(1-C). Then formulas
(5) and(3) will be rewritten in the form
x = (x_r + b/2*C)
x_r-x_l = b*C - b*z/h.
It is easy to see that b*C is the period of the stereogram for a flat surface z=0.
Let us denote it B.
So, the counting in cycles along y and x_r goes by formulas
x := x_r + B/2
z := z(x,y)
x_l := x_r - z*B/h
screen(x_r,y) := screen(x_l,y)

To symmetrize the picture/equations, you can either take a cycle on x
and calculate x_l and x_r by formulas (1a) and (2a) (but in this case black stripes may appear), or require that the average of the scanline z be equal to zero (for example, by calculating it and 'bending the edges' of the scanline to reach 0.


6.4. Shutter glasses.┼
²²²²²²²²²²²²²²²²²²▄
[Dmitry Tjurev, 2:5061/15.49]
One of the ways to obtain a truly three-dimensional image
is to use so-called shutter glasses. The principle of their work is this. as follows. The image for the left and right eyes
is built on two video pages. During the reverse stroke of the beam, the visibility of the pages is switched and at the same time a control signal is sent to the glasses, which in turn open one or the other eye, thus demonstrating its own video page for each eye. These glasses are called 3D-MAX. In essence, the principle of obtaining a three-dimensional image is similar to the red-blue one. glasses, with the only difference being that the latter loseinformation about color, but shutter glasses do not.
As for the principles of constructing images for each eye (this
applies to both shutter glasses and the red-blue mode).
Let's start with the fact that we should be able to obtain an image
of the scene from any point and in an arbitrary direction. Usually this
is used in 3D games, but no one bothers to use such an effect,
for example, in 3D studio. So, the first condition for obtaining volume is the separation of the observation points in space by a certain non-zero
distance, called stereobasis (here there is a direct analogy with the eyes ;).
The second condition is the reduction of the rays of vision to each other. Those. The rays of vision
must intersect at some distance from the observer. The object
located at the intersection point will be visually located in the plane
of the monitor screen. Everything located closer to this point will crawl out of
the screen, objects located behind the intersection of the rays will drown
in the monitor. You need to select the stereo basis and convergence angle very carefully, because otherwise, the stereo effect may turn out to be either too
implicit (the image is almost flat) or too pronounced (it is difficult to focus on
the picture).
[skip]
The FAQ uses excerpts from the DEMO.DESIGN FAQ. By the way, if you don't
^^^^^^^^^^^
found the answer to your question here - search there.