The Light.Spot class imitates a real-life spotlight—you can choose its location, the direction, and the light style and JavaFX will apply the corresponding lighting to your nodes.
The actual results are easier to understand in a dynamic form, so I've prepared a demonstration that allows all parameters to be tweaked:
Its listing is too long for the book; please find it on the book's GitHub. I'll provide only spotlight creation here:
// chapter8/light/SpotLightDemo.javaLight.Spot light = new Light.Spot(200, 150, 500, 1, Color.WHITE);light.setPointsAtX(100);light.setPointsAtY(100);light.setPointsAtZ(0);