Contents

Our brain is such a clever organ; it can do something that we don't know how it does. It catches a small difference between 2 images captured by our eyes and recognizes the depth and distance of the objects.

In this application, I used the method our brain does, and cheat it by making an unreal 3D environment.

In my previous article (Stereoscopy), I tried to explain some logic behind the stereoscopic systems and how you can make a 3D environment by moving the objects horizontally in the pair images. Now I wish to show how to make a 3D imagination of a 2D object only by skewing it. In this part, the ground is skewed from a simple image and makes a nice landscape.

I have to explain something first. In the pair images, when objects are in the same place, we saw them in the base of the scene. Actually the basement is equal to the infinity in the real world. When we change the place of the objects horizontally in one of the pair images, our brain detects it as a different depth from the basement. For example in parallel view, moving the objects of the left image to the right side, makes them appear closer to us and when you move them even more, they would be even more closer. There is an issue here. In the real world, the infinity is behind all other objects, but here, we can make objects behind the infinity! Just move an object of the left image to the left (instead of the right); you will see it behind the basement. You've accomplished an impossible mission!

When we skew the shape, a blank space would appear in the lower-right corner, so we would add some values to the width of the shape to hide it on the scene. This value is equal to the skew's amount.

Skew amount is calculated by dividing the height of the ground by altitude value (myGroundHeight/myAltitude), and must be added to the width of both skewed and non skewed shapes. The code is as follows:

You can change or add new objects to the environment. There are several directories in the executable file's place that contain these images. At the moment, there is any control on the images, so you have to resize them to the proper size.

There are different methods for this job, but the simplest are Parallel and Cross eye. In these methods, you don't need any additional devices, so you can do it anywhere and anytime. I explained these methods in my other article so you can try it here: Stereoscopy.