public static class Light.Spot extends Light.Point
Example:
Light.Spot light = new Light.Spot();
light.setX(150);
light.setY(100);
light.setZ(80);
light.setPointsAtX(0);
light.setPointsAtY(0);
light.setPointsAtZ(-50);
light.setSpecularExponent(2);
Lighting lighting = new Lighting();
lighting.setLight(light);
lighting.setSurfaceScale(5.0);
Text text = new Text();
text.setText("Spot");
text.setFill(Color.STEELBLUE);
text.setFont(Font.font(null, FontWeight.BOLD, 80));
text.setX(10.0);
text.setY(10.0);
text.setTextOrigin(VPos.TOP);
text.setEffect(lighting);
Rectangle rect = new Rectangle(200, 150);
rect.setFill(Color.ALICEBLUE);
rect.setEffect(lighting);
The code above produces the following:
Light.Distant, Light.Point, Light.Spot
Constructor and Description |
---|
Spot()
Creates a new instance of Spot light with default parameters.
|
Spot(double x,
double y,
double z,
double specularExponent,
Color color)
Creates a new instance of Spot light with the specified x, y, z,
specularExponent, and color.
|
Modifier and Type | Method and Description |
---|---|
double |
getPointsAtX() |
double |
getPointsAtY() |
double |
getPointsAtZ() |
double |
getSpecularExponent() |
DoubleProperty |
pointsAtXProperty() |
DoubleProperty |
pointsAtYProperty() |
DoubleProperty |
pointsAtZProperty() |
void |
setPointsAtX(double value) |
void |
setPointsAtY(double value) |
void |
setPointsAtZ(double value) |
void |
setSpecularExponent(double value) |
DoubleProperty |
specularExponentProperty() |
getX, getY, getZ, setX, setY, setZ, xProperty, yProperty, zProperty
colorProperty, getColor, setColor
public Spot()
public Spot(double x, double y, double z, double specularExponent, Color color)
x
- the x coordinate of the light positiony
- the y coordinate of the light positionz
- the z coordinate of the light positionspecularExponent
- the specular exponent, which controls the
focus of the light sourcecolor
- the color of the lightpublic final void setPointsAtX(double value)
public final double getPointsAtX()
public final DoubleProperty pointsAtXProperty()
public final void setPointsAtY(double value)
public final double getPointsAtY()
public final DoubleProperty pointsAtYProperty()
public final void setPointsAtZ(double value)
public final double getPointsAtZ()
public final DoubleProperty pointsAtZProperty()
public final void setSpecularExponent(double value)
public final double getSpecularExponent()
public final DoubleProperty specularExponentProperty()
Copyright © 2020. All rights reserved.