-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
OpenSceneGraph 3.0: Beginner's Guide
Like OpenGL, OSG only supports up to eight fixed-function light sources for directly illuminating the 3D scene, and won't be able to automatically generate and cast shadows are on objects. Light rays commonly originate from certain light sources, travel in straight lines, reflected on or scattered off scene objects, and are finally perceived by the viewer's eye. The light source properties, the surface material properties, and normals of geometries are all necessary to implement complete lighting effects.
The osg::Light class provides neat methods for operating on properties of a light source, including setLightNum() and getLightNum() for handling the OpenGL light number, setAmbient() and getAmbient() for the ambient component, setDiffuse() and getDiffuse() for the diffuse component of the light, and so on.
OSG also provides an osg::LightSource class for adding lights to the scene graph. It has a setLight() method and should be used as a leaf node with a single light...
Change the font size
Change margin width
Change background colour