Understanding Lighting in the Java 3D API Los Angeles CA

Creating scenes that appear to be three-dimensional on a flat two-dimensional screen is all about creating optical illusions. There are many important aspects to creating these optical illusions in 3D programming, not the least of which is lighting and illumination.

Local Companies

Moyea Software
92295612365
Hot building, ring street
LA, CA
Interneer Inc.
8005586832 x85
6101 W. Centinela Ave.
Culver City, CA
Cornerstone Concepts Inc
818-247-3909
600 W Broadway
Glendale, CA
Greene Computer Corporation
(818) 956-4961
200 S. Louise Street
Glendale, CA
Corticalx Inc Software Solutions & Technology
818-500-0881
425 E Colorado St
Glendale, CA
Alphatier Systems
818-409-8920
517 Griswold St
Glendale, CA
TimeTECH - Customizable Time and Attendance / Workforce Management Solutions
905-677-7009
7420 Airport Rd 203
Mississauga, CA
Hutchinson & Bloodgood, LLP
(818) 637-5000
101 N. Brand Blvd. #1600
Glendale, CA
Telsoft Solutions
818-545-8680
100 N Brand Blvd
Glendale, CA
Abraxas Technologies Inc
818-502-9100
450 N Brand Blvd
Glendale, CA

provided by: 
Originally published at Internet.com


Java Programming Notes # 1540 * Preface * Technical Discussion * The Program * The Number of Facets * The Shading Model * The Small Spheres * Emissive Color * Ambient Reflection and the AmbientLight Class * More Combinations of Light Source and Surface Reflection Properties * Diffuse Reflection and the DirectionalLight Class * The Shininess Property * Specular Reflection and the DirectionalLight Class * Shadows * Diffuse Reflection and the PointLight Class * Specular Reflection and the PointLight Class * Diffuse Reflection and the SpotLight Class * Specular Reflection and the PointLight Class * Run the Program * Summary * What's Next? * References * Complete Program Listing -----------------------------------

Preface

This is the first part of a multi-part lesson designed to help you understand the use of lighting and illumination in 3D scenes produced using the Java 3D API.

Optical illusions

Creating scenes that appear to be three-dimensional on a flat two-dimensional screen is all about creating optical illusions. There are many important aspects to creating these optical illusions in 3D programming, not the least of which is lighting and illumination.

A 3D simulator program

In this lesson, I will teach you about, and show examples of many of the important features of scene illumination in the Java 3D API. I will also provide the source code for a complete Java 3D lighting simulator program that you can compile and run to experiment with light in the Java 3D API. I will explain how that program works in subsequent parts of this multi-part lesson.

Viewing tip

You may find it useful to open another copy of this lesson in a separate browser window. That will make it easier for you to scroll back and forth among the different figures, tables, and listings while you are reading about them.

Supplementary material

I recommend that you also study the other lessons in my extensive collection of online Java tutorials. You will find those lessons published at Gamelan.com. However, as of the date of this writing, Gamelan doesn't maintain a consolidated index of my Java tutorial lessons, and sometimes they are difficult to locate there. You will find a consolidated index at www.DickBaldwin.com.

Technical Discussion

The Program

The program that I will present in this lesson can be used to experiment with most of the lighting and illumination features of the Java 3D API either individually or in combination.

In order to compile and run this program, you will need to download and install the Java 3D API. As of the date of this writing, it was available at: http://java.sun.com/products/java-media/3D/. The online documentation was available at: http://download.java.net/media/java3d/javadoc/1.4.0/.

In addition, you will need to download and install either Microsoft DirectX or OpenGL.

Our perception of 3D visual objects

From time to time, I will make references to Chapter 6 of a document published by Dennis J. Bouvier at the following URL. http://java.sun.com/developer/onlineTraining/java3d/. For example, here is a quotation from Bouvier:

"In the real world, the colors we perceive are a combination of the physical properties of the object, the characteristics of the light sources, the objects' relative positions to light sources, and the angle from which the object is viewed. Java 3D uses a lighting model to approximate the physics of the real world."

The mathematical 3D model

According to Bouvier, Section E.2 of the Java 3D API Specification presents the mathematical equations of the Java 3D lighting model. Still quoting Bouvier,

"The lighting model equation depends on three vectors: the surface normal (N), the light direction (L), and the direction to the viewer's eye (E) in addition to the Material properties of the object and the light characteristics."

This program makes it easy for the user to vary the surface normal (indirectly), the light direction, and the Material properties of the object. The program does not make it easy for the user to modify the direction to the viewer's eye. However, the primary experimental object is a large sphere which, because of its curvature, inherently results in a wide range of directions from the object's surface to the user's eye.

Light sources

Returning to Bouvier,

"The lighting model incorporates three kinds of real world lighting reflections: ambient, diffuse, and specular. Ambient reflection results from ambient light, constant low level light, in a scene. Diffuse reflection is the normal reflection of a light source from a visual object. Specular reflections are the highlight reflections of a light source from an object, which occur in certain situations."

This program makes it easy for the user to experiment with all three types of sources, plus another form of illumination referred to as emissive color.

Two user interfaces

This program produces two user interfaces. One interface is the display of a 3D scene containing five spheres as

Author: Richard G. Baldwin

Read article at Internet.com site

Featured Local Company

Moyea Software

92295612365
Hot building, ring street
LA, CA

Related Local Events
Automation Technology Expo West (ATX West)
Dates: 2/9/2010 - 2/11/2010
Location: Anaheim Convention Center
Anaheim, CA
View Details

SOLAR POWER - Exhibition and Conference
Dates: 10/12/2010 - 10/14/2010
Location: Los Angeles Convention & Exhibition Center
Los Angeles, CA
View Details

REAL-TIME & EMBEDDED COMPUTING CONFERENCE - LONG BEACH 2009
Dates: 10/1/2009 - 10/1/2009
Location: Marriott Long Beach
Long Beach, CA
View Details

2009 IEEE Petroleum and Chemical Industry Technical Conference (PCIC 2009)
Dates: 9/14/2009 - 9/16/2009
Location:
Anaheim, CA
View Details

Medical Design & Manufacturing - Trade
Dates: 6/9/2009 - 6/11/2009
Location: CANON COMMUNICATIONS LLC
Los Angeles, CA
View Details