A SERVICE OF

logo

202
Appendix B: Cosmo 3D Sample Application
// environment
csPointLight *lt = new csPointLight;
csEnvironment *environment = new csEnvironment;
environment->light()->append(lt);
environment->addChild(fgTransform);
environment->addChild(bgTransform);
return environment;
}
Understanding the Different Parts of Cube.cxx
The embedded comments in Example B-1 call out the different functional parts of
cube.cxx, which include:
Include statements and global method declarations.
Create a window in which the application runs and with which a user can interact
with the application. For more information, see Chapter 12, User Interface
Mechanisms.
Instantiate and setup a camera. For more information, see Chapter 9, Viewing the
Scene.
Create a scene graph. For more information, see Chapter 4, Scene Graph Nodes.
Draw and rotate the cubes represented by the data in the scene graph. For more
information, see Chapter 6, Placing Shapes in a Scene.