Lighting, Fog, and Background

Lighting, Fog, and Background

Chi Chung Ko (National University of Singapore, Singapore) and Chang Dong Cheng (CCS Automation PTE LTD, Singapore)
Copyright: © 2009 |Pages: 18
DOI: 10.4018/978-1-59904-789-8.ch006
OnDemand PDF Download:


How the properties of virtual 3D objects can be specified and defined has been discussed in earlier chapters. However, how a certain virtual object will appear to the user will in general depends also on human visual impression and perception, which depends to a large extent on the lighting used in illumination. As an example, watching a movie in a dark theatre and under direct sunlight will give rise to different feeling and immersion even though the scenes are the same. Thus, in addition to defining the skeleton of a virtual object by using geometry objects in Java 3D in Chapter III, setting the appearance attributes in Chapter IV and applying texture in Chapter V to give a realistic skin to the virtual object, appropriate environmental concerns such as light, background and even fog are often necessary to make the virtual object appear as realistic to the user as possible. In this chapter, we will discuss topics related to the latter environmental issues. The use of proper lighting is thus crucial to ensure that the 3D universe created is realistic in feeling and adds to strong emotional impressions in any application. For this purpose, Java 3D has a variety of light sources that can be selected and tailored to different scenarios. Technically, light rays are not rendered. In fact, their effects will only become visible once they hit an object and reflect to the viewer. Of course, as with any object in the real world, the reflection depends on the material attributes of the objects. In this chapter, we will discuss the use of different types of light source and their effects after describing the lighting properties or materials of visual objects. We will then outline the use of fogging techniques to turn a hard and straight computer image into a more realistic and smoother scene before discussing methods for immersing active visual objects in a background.
Chapter Preview


The use of the material class has been discussed in Chapter III on appearance. Basically, four components, ambient, emissive, diffuse, specular and shininess, are involved in specifying a material.

Emissive corresponds to the color of the material that will be emitted, and is independent of other external light color and intensity. Ambient is associated with reflection from ambient light sources, specular and shininess are associated with highlight and strong reflections, while diffuse corresponds to normal reflection from diffused sources. Figure 1 gives a summary on how the various material components can be specified.

Figure 1.

Specifying material

Note, however, that the material appearance of an object under various light sources will be properly seen only after setting the normal of the object properly. This is because the reflection of light is with respect to the normal direction, and changing the normal direction will affect the direction of the reflected lights.

Figure 2 illustrates the concepts of face normal and vertex normal, using a pyramid as an example. For the triangular face formed with vertices 1, 2, and 3 or points A, B, and C, the face normal will be the cross product of the vectors AC and AB. On the other hand, the vertex normal is the sum of all the normals of the faces that intercept to form the vertex.

Figure 2.

Face normal and vertex normal

The setting of the normal of faces can be carried out manually or automatically using com.sun.j3d.utils.geometry.GeometryInfo and com.sun.j3d.utils.geometry.NormalGenerator. This is illustrated in the examples in Figure 3.

Figure 3.

Setting the normal manually and automatically

To achieve special effects such as bumping, the normal can be set manually so that it becomes slanted as shown in Figure 4. As illustrated, the direction of the reflected ray will be changed correspondingly, leading to interesting visual effects.

Figure 4.

Baising of normal

Complete Chapter List

Search this Book:
Table of Contents
Chi Chung Ko
Chapter 1
Chi Chung Ko, Chang Dong Cheng
Web-based virtual reality is fast becoming an important application and technological tools in the next generation of games and simulation as well... Sample PDF
Virtual Reality and Java 3D
Chapter 2
Java 3D Overview  (pages 18-31)
Chi Chung Ko, Chang Dong Cheng
In the last chapter, a brief introduction on the creation of 3D content through the use of Java 3D and other programming methodologies for virtual... Sample PDF
Java 3D Overview
Chapter 3
Geometry Objects  (pages 32-74)
Chi Chung Ko, Chang Dong Cheng
To create 3D graphics, we have to build graphics or visual objects and position them appropriately in a virtual scene. In general, there are three... Sample PDF
Geometry Objects
Chapter 4
Appearance Objects  (pages 75-96)
Chi Chung Ko, Chang Dong Cheng
In the last chapter, the creation of the skeletons or shapes of 3D objects has been discussed through the use of geometry objects in Java 3D. In... Sample PDF
Appearance Objects
Chapter 5
Textures  (pages 97-113)
Chi Chung Ko, Chang Dong Cheng
Although extensive use of basic attributes such as color and material will be able to make an object realistic to the human user, it will be time... Sample PDF
Chapter 6
Chi Chung Ko, Chang Dong Cheng
How the properties of virtual 3D objects can be specified and defined has been discussed in earlier chapters. However, how a certain virtual object... Sample PDF
Lighting, Fog, and Background
Chapter 7
Animation Objects  (pages 132-158)
Chi Chung Ko, Chang Dong Cheng
We have discussed important Java 3D objects that are basically static in the last few chapters. Starting from this chapter, we will be looking at... Sample PDF
Animation Objects
Chapter 8
Interaction  (pages 159-187)
Chi Chung Ko, Chang Dong Cheng
In Chapter VII, we discussed how animation can be applied in Java 3D to increase the visual impact of a virtual 3D world and illustrate the dynamic... Sample PDF
Chapter 9
Picking  (pages 188-216)
Chi Chung Ko, Chang Dong Cheng
The last two chapters have discussed how animation and interaction can be created in Java 3D to increase visual impact, to show object dynamics and... Sample PDF
Chapter 10
Chi Chung Ko, Chang Dong Cheng
One of the most useful and important advantages of 3D graphics rendering and applications is that there is the possibility for the user to navigate... Sample PDF
Navigation, Input Devices, and Collision
Chapter 11
Multiple Views  (pages 238-263)
Chi Chung Ko, Chang Dong Cheng
Our discussions in previous chapters have centered on the creation and interaction of visual objects in a virtual 3D world. The objects and scenes... Sample PDF
Multiple Views
Chapter 12
Audio  (pages 264-275)
Chi Chung Ko, Chang Dong Cheng
Of all the human perceptions, two of the most important ones are perhaps vision and sound, for which we have developed highly specialized sensors... Sample PDF
Chapter 13
Chi Chung Ko, Chang Dong Cheng
In this final chapter, we will describe the use of Java 3D as a visualization technology in the development of a Web-based 3D real time oscilloscope... Sample PDF
A Web-Based 3D Real Time Oscilloscope Experiment
Appendix A: Downloading Software
Appendix B: Running the Rotating Cube Program
Appendix C: ViewManager
Appendix D: Main Applet for Web-Based 3D Experiment
Appendix E: Scene Graph Implementation for Web-Based 3D Experiment
Appendix F: Knob Class for Web-Based 3D Experiment
Appendix G: Navigation and Collision Detection for Web-Based 3D Experiment
Appendix H: Picking for Web-Based 3D Experiment
Appendix I: Program Summary and Screen Capture
About the Authors