< Zurück | Inhalt | Weiter >

CHAPTER 10

Lights

10.1 Lights


10.2 Light node


10.3 AmbientLight


10.4 DirectionalLight


10.5 PointLight


10.6 SpotLight


10.7 Lighting, material attributes, and per−vertex colors 10.8 Summary

Lighting is an important topic in 3D graphics. The lights that you choose for your scene can have a profound impact, making it appear, for examples, highly atmospheric or almost photographically realistic or flat and artificial. There are two basic problems with setting up lighting for your scene. The first is to understand how lighting is calculated, as well as understanding the mechanics of setting up lighting parameters and doing the necessary programming. The second problem is aesthetic and involves making artistic decisions regarding how you want your scene to appear. Because lights can also be computationally expensive, you need to use them carefully and ensure you are striking the right balance between frame rate and responsiveness on the one hand and a richly shaded scene on the other.


Figures 10.2 through 10.15 show a scene viewed under different lighting conditions. The illustrations give an indication of the lighting effects that are possible using Java 3D and provide a starting point for designing your own scene lighting. You’ll want to run the example application to see the color illustrations for the full effect. You can also refer to the ebook edition of this book, available from the publisher’s web site at
http://www.manning.com/selman
, which contains color illustrations.


The LightTest example application allows you to interactively modify lighting parameters and view the results.