A SERVICE OF

logo

35
Chapter 3
3. Specifying the Appearance of Geometries
The geometry and appearance of a shape are independent of one another. The
appearance of a shape is the two-dimensional texture, such as the rind of an orange, that
is mapped onto a geometry.
This chapter describes how to specify the appearance of a geometry in the following
sections::
•“csContext Overview on page 35.
•“Changing the Context on page 39.
•“Using csAppearance on page 40.
•“Applying Textures to Geometries on page 42.
•“Material Settings on page 51.
•“Shade Model Settings on page 53.
•“Transparency Settings on page 53.
•“Making the Screen One Color on page 39.
csContext Overview
A csContext object maintains the OpenGL graphics state for a scene graph and therefore
contains all the default appearance values necessary to render a shape.
Appearance values, such as material and texture, can be specied per shape using
csAppearance. If csAppearance elds are not set, the shape inherits the default
appearance values set in csContext. For optimal performance, set as few csAppearance
object elds as possible by setting the global defaults in csContext to values that satisfy
the majority of geometries in a scene graph. This practice minimizes state changes while
rendering.