3D Graphics Systems Course

3D Graphics Systems Course 2013

This works was presented as one of the projects of the 3D Graphics Systems course, taught on IMPA by professor Luiz Velho from March to July 2013. Many concepts learned on the course were applied on this project. From the course syllabus it is possible to relate this work with Geometric Models, Modeling Techniques, Transformations and Hierarchies, Camera and Viewing Transformations, Clipping, Rasterization, Visible Surface Determination and Texture Mapping.

OpenGL ES 2.0 was used to implement this real time rendering system. The next section describes the basic ideas behind this project.


Technical Description

Each layer of panorama is a 3D mesh of a sphere parametrized by latitude and longitude. This parametrization has a natural association with equirectangular images, which makes easier to compute the texture coordinates of each vertex. After this modeling step, it is necessary to set an image as texture to the sphere.

With the sphere modeled and textured, we must create a camera abstraction in which the observer stays always at the center of the sphere. Panoramic images have only one visualization point, the point where the image was taken (projection point), so the observer must be fixed on this point, but can look to any direction, which is achieved by rotation transformations.

In a mobile phone running Android OS, it is possible to merge data from magnetometer and accelerometer to compute device's orientation. We use this information to get a transformation matrix from the world's coordinate system to the device's coordinate system and use it as the view matrix for our camera.

The outer most layer is called background layer. All layers are added concentrically and inner to the background layer. The background image can be an opaque image, but the images used on the inner layers should have the alpha channel in order to make a good composition.

It was also created a hierarchical structure, a basic scene graph, to help managing all objects in the scene and define relationships between one and another. This way, we can easily move layers together or move one layer relative to another.

The OpenGL Depth Buffer isn't enabled in this application. To solve visibility problem, layers are drawn from the outer most to the inner most, as the Painter's Algorithm would do. As all elements in the scene belong to some layer, and layers can be ordered based on radius value, we can guarantee that we will never have a loop on scene's occlusion graph.