Realization of the true 3D effect in your projects

image

Today I’ll try to get a real 3D picture without nVidia 3D Vision, special glasses and a 120Hz monitor. The work will be done using the GLScene graphics library for Delphi / Lazarus / Borland C ++ on a PC with mediocre characteristics. You can repeat these steps using the camera, programs with the function of modeling 3D images (for example, MathCAD, Maya, etc) or any GAPI. At the end of the article, we should get a three-dimensional image outside the monitor, which can be “touched”. This is not a revolution in technology, but a simple stereoscopic effect, which in life is small, but useful for eyesight fun.

Stereo image


I will not describe here everything that Google can tell. Only the most important and necessary for work.
A stereo pair is a type of stereo image represented by a pair of flat perspective images of an object obtained from two different points of view located at a distance corresponding to the interpupillary distance of a person.
First of all, we are interested in a horizontal stereo-pair (side-by-side), which can be of two types: parallel and cross.

imageIn parallel stereo pairs, the left image is for the left eye, and the right image is for the right. For such images, the direction of view must be arranged in parallel, as if we were observing an object behind the screen.

Below you can see an example of a parallel stereo pair, and on the right is an image illustrating the direction of view.
image


In cross stereo pairs, the opposite is true: the left image is for the right eye, and the right image is for the left. To observe the stereoscopic effect, we need to cross our eyes. An imaginary image will be located between you and the monitor, which will allow you to try to "touch" it.

An example from a past case. Just rearranged the images:
image


For each stereo image, there are two imaginary ones - the main three-dimensional, and the mirror, turned inside out. If you saw a mirror image, just change the focus to another (from cross to parallel or vice versa). For clarity, you can practice with the following image. It will change the depth of the digits relative to each other:
image

If the farthest number is 5, and the closest 4, then you are now looking at an example as a cross stereo pair. If on the contrary - as in parallel.

Viewing such pictures is an excellent vision training for people who have a focal point for a long time located at the same distance from the eyes. This description includes people who work on paper or on a PC. With a good workout with various stereo images, you can get rid of glasses and prevent the muscles of the eyeballs. But do not forget the measure, here as in sports: if it is not enough, then it is useful, if professionally, then you can be crippled. Parallel stereo pairs are more favorable for our vision, since this is a natural view of a person, but to learn how to see them, you need to practice well.
Only about 5% of people cannot see stereo images at all. These people are not able to see the world in volume and do not provide them with the right to drive a car.

Implementation


For implementation on a photo / video camera, we need to place 2 devices on the same horizontal bar with a distance between the lenses of 7-8 cm. After that, combine the finished photos or video tracks horizontally. Do not forget that you need to look at the images without tilting your head.

Now we implement this effect using the GLScene graphics library. We launch the used IDE, create the VCL / LCL application, place on the form TGLScene and two TGLScreenViewer. Set the shape size to 800x400 and place viewers on it on the left and right sides. In TGLScene we create two cameras, a light source that should be placed in the second camera, a ball, a pair of cubes, a plane. Place both cameras in the TGLDummyCube, set the dummy as TargetObject. The coordinates of the cameras (3.0, -0.1) and (3.0.0.1). Do not forget to assign each viewer its own camera. There is no need to code. Desired system requirements: widescreen monitor.

Here's what I got (cameras are set up for a cross stereo pair):
image

Download example.
Based on this, you can make a game, a demoscene, or in a mathematical package to see a complex schedule.

Thank you all for your attention!

useful links


fishki.net/comment.php?id=65203
images.google.com
google.ru

Examples of parallel and cross stereopairs were taken from Wikipedia, the remaining pictures are repeatedly repeated on various sites with stereo images without attribution.

Also popular now: