The Wizards Wiki

Explore your world

User Tools

Site Tools


documentation:anaglyph3d

Anaglyph3D

Some 3dsmax experimenting resulted in a little side-project on the rendering of anaglyph3D images. The goal is to be able to render a scene and to transform the rendered images into an anaglyph3D image.

Theory

To be able to create an anaglyph3D image, we need two images representing the scene observed by each eye:

Left eye image Right eye image

The cameras recording these two images should have the same distance between them in (virtual)worldspace as the distance between the human eyes. To achieve this, a 3Dcamera-rig was created in 3dsmax.

Next, to get the desired 3D effect, an image needs to be calculated using these two images. The left eye of anaglyph3D glasses is tinted red, the right eye blue. Thus, the combined image should contain the red channel of the left eye image and the blue and green channels of the right eye image.

To do this, a little java application called 'Anaglyph3DCombiner' was created.

3D Camera-rig

In 3dsmax, i created a scene containing the setup for rendering anaglyph3D images so that this scene could easily be imported into any scene where i want to render images in 3D.

The scene consists of two cameras at a distance equal to the distance between the human eyes. The two cameras have the same focus point. Objects near the focus point have the best 3D effect. Objects closer to the cameras will appear a bit blurry and have a strong 3D effect (too close and the effect becomes annoying). Objects behind the focus point have less 3D effect and appear to be farther in the screen/to be flat.

3D camera rig

The rig is set up so that rotating the sphere surrounding the cameras results in rotating both cameras at the same time around the center of the sphere.

Manipulating the camera direction helper results in manipulating the direction of the two cameras at the same time.

Manipulating the camera focus helper results in manipulating the focus point of the two cameras at the same time.

Anaglyph3dCombiner

This application lets the user choose a left and right eye image sequence, an output path and the number of frames to combine, making use of a simple gui:

Anaglyph3DCombiner GUI

The application combines the images as described in the 'Theory' section above and saves the result at the specified output path. It is possible to just render one image or a whole sequence of images.

The application can also be used with other images than 3dsmax renderings using the 3Dcamera-rig (eg two photographs), although the resulting image may not be too accurate.

Resulting image

This is what the final image looks like:

Final result

documentation/anaglyph3d.txt · Last modified: 2024/08/26 13:25 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki