Game Development Reference
In-Depth Information
The PointLight class represents our light source. This light is modeled after a point light source, such
as the sun. This kind of light is located at a single point in space, with light radiating in all directions.
Light characteristics include ambient color, diffuse color, and specular color.
The Vector3 class holds data for a 3D vector consisting of x, y, and z components, as well as 3D
vector math functions.
I cover the classes mentioned above in more detail in later chapters, so don't worry if you don't
completely understand all the concepts. The purpose of this chapter is to give you a brief overview of
some of the key classes contained in this topic and show you how they are used in an actual program.
Experimenting with “Hello Droid”
Let's do some hands-on experimentation and play around with the lighting. Run the “GLHelloWorld”
program on your Android phone that has version 2.2 or more recent versions of the operating
system. Figure 2-2 shows what you should see by default. You should be seeing a 3D rotating cube
with a texture of the Android robot placed on two sides of it.
Figure 2-2. Default output
Stop the cube rotation by commenting out the statement in the onDrawFrame() function that rotates
the cube, as follows:
//m_Cube.m_Orientation.AddRotation(1);
 
Search WWH ::




Custom Search