Rendering Stereoscopic 3D Images and Video
You probably know stereoscopic 3D videos from the cinema. The Bino video player can play them, and there are some example videos on the Bino website.
These videos were rendered with WurblPT, and this article explains how that is done.
In general you need to render two images instead of one: a left eye view and
a right eye view. There are lots of possibilities to combine both views into a single image.
WurblPT uses the top-bottom layout, where the left eye view is placed on top of the right
eye view so that you get a combined image that is twice as high as a traditional 2D image:
- Use the eye distance d as the parameter that determines the distance between left and right eye
- Determine the 2D camera center (typically (0,0,0), but it depends on optics effects)
- Move the left eye camera to the left along the x axis by d/2
- Move the right eye camera to the right along the x axis by d/2
- Apply camera transformation / animation
- Generate the view ray according to the camera frustum
Note that this approach only works for traditional images. For 180°/360° surround images, the left and right camera centers differ for each pixel.
See camera.hpp for details, and have a look at wurblpt-sponza and wurblpt-rolling-marbles to see how these camera models are used to render the Bino example scenes.