Figure 4-1. Sample lights
The screenshot in Figure 4-1 shows three rectangles, the left one illuminated by a DistantLight , the
center illuminated by a PointLight and the right illuminated by a SpotLight . Here's how each light works:
DistantLight: A DistantLight is a far-away light and will illuminate a Node evenly from one direction.
Much like the Sun, this light will strike every node in a group from the same direction. In JavaFX, how
this light hits its target can be specified by setting the properties azimuth and elevation . Azimuth
describes the angle from which the light will be coming. An azimuth of 0.0 is to the right of a Node while
an azimuth of 90.0 is from the bottom, and so forth.
Elevation describes how directly or obliquely the light will hit the node. An elevation of 0.0 indicates
that the DistantLight is shining on the node from the plane of the screen, while an elevation of 90.0
indicates the DistantLight is coming from the perspective of the user.
PointLight: A PointLight is a light that exists someplace in the scene and illuminates Nodes from a
specific point in space. This is much like a bare light bulb in a dark room. By specifying an X, Y, and Z
coordinate for a PointLight , an object can be illuminated as if it is very close to a light, or very distant.