Java Reference
In-Depth Information
Figure 4-3. Distant light on the top
Figure 4-2 shows the text is being illuminated from the right so that the right side of each letter is
brighter than the left side. In Figure 4-3, the letters are lit from the top. The code in Listing 4-2 creates an
animation that includes the two scenes.
Listing 4-2. Main.fx (distantLight)
function distantLight():Void{
var elev = 0.0;
var azim = 0.0;
var lighting = Lighting {
light: DistantLight { azimuth: bind azim, elevation: bind elev }
surfaceScale: 3
Search WWH ::

Custom Search