Table of Contents Previous Chapter Details Viewpoint Slideshow Next Chapter Details X3D Resources

X3D Example Archives: VRML 2.0 Sourcebook, Chapter 20 - Lighting

Figure 20.06b Point Light Spheres Intensity

Figure 20.13a Directional Light Sunrise

By default, you have one light in the scene, attached to your head. For more realism, you can add multiple lights: suns, light bulbs, candles, flashlights, spotlights, firelight. Lights can be positioned, oriented, and colored. Lights do not cast shadows.

There are three types of lights: PointLight, DirectionalLight, and SpotLight. All lights have an on/off, intensity, ambient effect, and color fields. PointLight and SpotLight nodes have a location, radius, and attenuation. DirectionalLight and SpotLight nodes have a direction.

These X3D scenes are adapted directly from the original VRML 2.0 Sourcebook chapter examples. Also available: Introduction to VRML97 SIGGRAPH98 course notes.

X3D Scenes Descriptions
Figure 20.04 Headlight Spheres A sphere world illuminated by the headlight. Also see Figures 20.4, 20.6a, 20.6b, 20.7, 20.8 for comparison.
Figure 20.05 Flat Mesh A flat mesh created using an ElevationGrid node.
Figure 20.06a Point Light Spheres A sphere world illuminated by a point light in the center. Also see Figures 20.4, 20.6a, 20.6b, 20.7, 20.8 for comparison.
Figure 20.06b Point Light Spheres Intensity A sphere world illuminated by a point light with its ambient intensity set high. Also see Figures 20.4, 20.6a, 20.6b, 20.7, 20.8 for comparison.
Figure 20.07 Point Light Spheres Attenuation A sphere world illuminated by a point light with attenuation control. Also see Figures 20.4, 20.6a, 20.6b, 20.7, 20.8 for comparison.
Figure 20.08 Point Light Spheres Small Radius A sphere world illuminated by a point light with a small radius. Also see Figures 20.4, 20.6a, 20.6b, 20.7, 20.8 for comparison.
Figure 20.09 Glowing Orb Archways Exhibit A glowing sphere within a gothic building.
Figure 20.10 Blinking Red Lightbulb A blinking lightbulb showing multiple lighting effects.
Figure 20.11a Directional Light Aiming Right Through Spheres A sphere world illuminated by a DirectionalLight aiming to the right. Compare Figures 20.11a, 11b, 12.
Figure 20.11b Directional Light Aiming Upper Right Through Spheres A sphere world illuminated by a DirectionalLight aiming up and to the right. Compare Figures 20.11a, 11b, 12.
Figure 20.12 Two Directional Lights Aiming Left Right Through Spheres A sphere world illuminated by a DirectionalLight aiming up and to the right. Compare Figures 20.11a, 11b, 12.
Figure 20.13a Directional Light Sunrise A DirectionalLight used to simulate the sun at sunrise. Compare Figures 20.13a, 13b, 13c, 14.
Figure 20.13b Directional Light Noon A DirectionalLight used to simulate the sun at noon. Compare Figures 20.13a, 13b, 13c, 14.
Figure 20.13c Directional Light Sunset A DirectionalLight used to simulate the sun at sunset. Compare Figures 20.13a, 13b, 13c, 14.
Figure 20.14 Directional Light Sun Animated A DirectionalLight simulates the sun from sunrise through sunset, animated using multiple interpolators. Compare Figures 20.13a, 13b, 13c, 14.
Figure 20.15a Spot Light Spheres A sphere world illuminated by a SpotLight aiming to the right. Compare Figures 20.15a, 15b.
Figure 20.15b Wide Angle Spot Light Spheres A sphere world illuminated by a wide-angle SpotLight aiming to the right. Compare Figures 20.15a, 15b.
Figure 20.16 Spot Light Beam Width Comparison Three meshes illuminated by separate spotlights, with outer cone set to 45 degrees and inner cones set to 45, 22 1/2, and 1/2 degrees respectively. Combines Figures 20.16a, 16b, 16c.
Figure 20.17a Simple World No Shadows A simple world without fake shadows. Compare Figures 20.17a, 17b.
Figure 20.17b Simple World Fake Shadows A simple world with fake shadows. Compare Figures 20.17a, 17b.

Online at http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter20-Lighting

Master source code archive is under subversion control at
http://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter20-Lighting

Table of Contents Previous Chapter Details Viewpoint Slideshow Next Chapter Details X3D Resources

Also available: current and archived nightly builds and distributions of these examples, all published under an Open-Source License.

The X3D Resources: Examples page and Savage Developers Guide provide more information about the production of this archive.