Nokia N97 SDK Example Applications Guide |
OpenGL ES Projective Shadow Example
1. About this Example
2. Prerequisites
3. Desing and Implemention
This example demonstrates the creation of projective planar shadows. The example consists of a single shadow object, a single
light source, and a planar ground plane, where the shadow is projected. The user can change the position of the light source
by turning the joystick left or right.
This example can be extended to any kind of OpenGL ES application, but you might want to look at the other example applications
as well for how to use other, different kinds of, OpenGL ES features.
Only classes used by this example are the basic UI framework baseclasses. Open GL ES itself is pure C method call API and
doesn't use classes.
To build and run this example you need to have the S60 SDK installed and working correctly on your computer. You also need
basic understanding on how to build S60 applications.
To work with this example application you need basic understanding on how to build S60 applications and basic undestanding
of how Symbian (or COE) UI and application framework works. Also basic knowledge on OpenGL or OpenGL ES is required if you
wish to modify the example.
The order of rendering the scene is important in order to make the shadows appear correctly. The following order is used in
this example:
1. Draw the ground objects, that is, the ground plane.
2. For each light source and for each shadow object:
a. Set the correct shadow matrix.
b. Set the current color to black.
c. Draw all the objects that cast shadows with black color.
3. Draw all the shadow objects without the shadow matrix and with the real object colors/textures.
Another important thing is the correct position of the shadow matrix. It has to be placed in the current modelview matrix
after the camera transformations and before the model transformations.
The application has only NONE capability as it only needs the rights to execute and access to the screen.
All Open GL ES examples support various screen modes. The examples also support changing the screen size while the application
is running.
|
© Nokia 2009
|

|