direction vector
property.
In addition to the attenuation factors that control the light intensity over
distance, a SpotLight has a light-cone attenuation factor, spot, that is determined by 3 properties:
innerAngle: the angle of the inner cone (see image below)
outerAngle: the angle of the outer cone (see image below)
falloff: the factor that controls the light's intensity drop inside the outer cone
0 <= innerAngle <= outerAngle <= 180 and falloff >= 0;
values outside either of these ranges can produce unexpected results.
The angle of a point to the light is defined as the angle between its vector to the light's position and the
direction of the light. For such an angle theta, if
theta < innerAngle then spot = 1
theta > outerAngle then spot = 0
innerAngle <= theta <= outerAngle then
spot = pow((cos(theta) - cos(outer)) / (cos(inner) - cos(outer)), falloff)which represents a drop in intensity from the inner angle to the outer angle.
0 <= spot <= 1. The overall intensity of the light is I = lambert * atten * spot.
SpotLights can represent point-like light sources with directionality. Flashlights and floodlights are
common light sources that can be simulated with this light type.
PhongMaterial
| Modifier and Type | Field and Description |
|---|---|
| private static final Point3D | |
| private static final double | |
| private static final double | |
| private static final double | |
| private ObjectProperty | direction
The direction vector of the spotlight. |
| private DoubleProperty | falloff
The intensity falloff factor of the spotlight's outer cone. |
| private DoubleProperty | innerAngle
The angle of the spotlight's inner cone, in degrees. |
| private DoubleProperty | outerAngle
The angle of the spotlight's outer cone, in degrees (as shown in the class doc image). |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final ObjectProperty | |
| private NGNode | |
| private void | |
| public final DoubleProperty | |
| public final Point3D | |
| public final double | |
| public final double | |
| public final double | |
| public final DoubleProperty | |
| public final DoubleProperty | |
| public final void | |
| public final void | |
| public final void | |
| public final void |
| DEFAULT_DIRECTION | back to summary |
|---|---|
| private static final Point3D DEFAULT_DIRECTION | |
| DEFAULT_FALLOFF | back to summary |
|---|---|
| private static final double DEFAULT_FALLOFF | |
| DEFAULT_INNER_ANGLE | back to summary |
|---|---|
| private static final double DEFAULT_INNER_ANGLE | |
| DEFAULT_OUTER_ANGLE | back to summary |
|---|---|
| private static final double DEFAULT_OUTER_ANGLE | |
| direction | back to summary |
|---|---|
| private ObjectProperty<Point3D> direction The direction vector of the spotlight. It can be rotated by setting a rotation transform on the
| |
| falloff | back to summary |
|---|---|
| private DoubleProperty falloff The intensity falloff factor of the spotlight's outer cone. A point whose angle to the light is greater than the inner angle but less than the outer angle receives partial intensity governed by this factor. The larger the falloff, the sharper the drop in intensity from the inner cone. A falloff factor of 1 gives a linear drop in intensity, values greater than 1 give a convex drop, and values smaller than 1 give a concave drop. See the class doc for more information.
The valid range is
| |
| innerAngle | back to summary |
|---|---|
| private DoubleProperty innerAngle The angle of the spotlight's inner cone, in degrees. A point whose angle to the light is less than this angle is
not attenuated by the spotlight factor (
The valid range is
| |
| outerAngle | back to summary |
|---|---|
| private DoubleProperty outerAngle The angle of the spotlight's outer cone, in degrees (as shown in the class doc image). A point whose angle to the
light is greater than this angle receives no light (
The valid range is
| |
| SpotLight | back to summary |
|---|---|
| public SpotLight() Creates a new instance of | |
| SpotLight | back to summary |
|---|---|
| public SpotLight(Color color) Creates a new instance of
| |
| directionProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| doCreatePeer | back to summary |
|---|---|
| private NGNode doCreatePeer() | |
| doUpdatePeer | back to summary |
|---|---|
| private void doUpdatePeer() | |
| falloffProperty | back to summary |
|---|---|
| public final DoubleProperty falloffProperty() | |
| getDirection | back to summary |
|---|---|
| public final Point3D getDirection() | |
| getFalloff | back to summary |
|---|---|
| public final double getFalloff() | |
| getInnerAngle | back to summary |
|---|---|
| public final double getInnerAngle() | |
| getOuterAngle | back to summary |
|---|---|
| public final double getOuterAngle() | |
| innerAngleProperty | back to summary |
|---|---|
| public final DoubleProperty innerAngleProperty() | |
| outerAngleProperty | back to summary |
|---|---|
| public final DoubleProperty outerAngleProperty() | |
| setDirection | back to summary |
|---|---|
| public final void setDirection(Point3D value) | |
| setFalloff | back to summary |
|---|---|
| public final void setFalloff(double value) | |
| setInnerAngle | back to summary |
|---|---|
| public final void setInnerAngle(double value) | |
| setOuterAngle | back to summary |
|---|---|
| public final void setOuterAngle(double value) | |