Package heronarts.lx.model
Class LXPoint
java.lang.Object
heronarts.lx.model.LXPoint
- Direct Known Subclasses:
GridModel.Point
A point is a node with a position in space. In addition to basic
x/y/z coordinates, it also keeps track of some helper values that
are commonly useful during animation. These include normalized values
relative to a containing model, as well as polar versions of the
xyz coordinates relative to the origin.
A point is also assumed to be a member of a larger set of points
for which there is an array buffer of color values. The
index
field refers to this points position in that buffer.
Generally speaking, point geometry should be treated as immutable.
Direct modifications to the values are permitted, but will not
trigger updates to the geometry of a containing LXModel.-
Field Summary
FieldsModifier and TypeFieldDescriptionfloatAngle of this point about the origin in the x-z plane (right-handed angle of rotation about the Y-axis) 0 is pointing straight ahead (+z axis) HALF_PI is to the right (+x axis) PI is backwards (-z axis) 1.5*PI is to the left (-x axis)static final floatfloatAngle of this point between the y-value and the x-z plane 0 is flat HALF_PI is upwards (+y axis) -HALF_PI is downwards (-y axis)intIndex of this point into color bufferfloatRadius of this point from the origin (0, 0, 0) in 3 dimensionsfloatRadius of this point from the center of the reference modelfloatNormalized position of point in radial space from center of model, 0 is center, 1 is point with max radius from centerfloatNormalized position of point in radial space (0-1), 0 is origin, 1 is max radiusfloatRadius of this point from origin (0, 0) in the x-y planefloatRadius of this point from origin (0, 0) in the x-z planefloatCustom size of this point in the UI (defaults to DEFAULT_POINT_SIZE)floatAngle of this point about the origin (0, 0) in the x-y planefloatX coordinate of this point (absolute)floatNormalized position of point in x-space (0-1);floatNormal vector x in direction this light points (optional)floatY coordinate of this point (absolute)floatNormalized position of point in y-space (0-1);floatNormal vector y in direction this light points (optional)floatZ coordinate of this point (absolute)floatNormalized position of point in z-space (0-1);floatNormal vector z in direction this light points (optional) -
Constructor Summary
ConstructorsConstructorDescriptionLXPoint()Construct an empty point, value 0, 0, 0LXPoint(double x, double y, double z) Construct a point in 3-d spaceLXPoint(float x, float y) Construct a point in 2-d space, z will be 0LXPoint(float x, float y, float z) Construct a point in 3-d spaceConstruct a copy of another pointLXPoint(LXTransform transform) Construct a point from transformConstruct a point in 3-d space based upon a vector -
Method Summary
Modifier and TypeMethodDescriptionMultiplies the points coordinates by the given transformation matrixprotected LXPointset()Updates the point's meta-coordinates, based upon the x y z values.set(float x, float y, float z) Updates this point to a new x-y-z positionSets the values of this point based upon another pointSet the x, y, and z values based upon the position of a transform matrixSet the x, y, and z values based upon another point multiplied by a transform matrixSet the x, y, and z values based upon another point multiplied by a transform matrixset(LXTransform transform) Set the x, y, and z values based upon the position of the transformsetNormal(float xnormal, float ynormal, float znormal) Set the normal vector values for this pointsetX(float x) Sets the X coordinate of the pointsetY(float y) Sets the Y coordinate of the pointsetZ(float z) Sets the Z coordinate of the pointfloatxn(LXNormalizationBounds bounds) Deprecated.floatyn(LXNormalizationBounds bounds) Deprecated.floatzn(LXNormalizationBounds bounds) Deprecated.
-
Field Details
-
DEFAULT_POINT_SIZE
public static final float DEFAULT_POINT_SIZE- See Also:
-
x
public float xX coordinate of this point (absolute) -
y
public float yY coordinate of this point (absolute) -
z
public float zZ coordinate of this point (absolute) -
r
public float rRadius of this point from the origin (0, 0, 0) in 3 dimensions -
rc
public float rcRadius of this point from the center of the reference model -
rxy
public float rxyRadius of this point from origin (0, 0) in the x-y plane -
rxz
public float rxzRadius of this point from origin (0, 0) in the x-z plane -
theta
public float thetaAngle of this point about the origin (0, 0) in the x-y plane -
azimuth
public float azimuthAngle of this point about the origin in the x-z plane (right-handed angle of rotation about the Y-axis) 0 is pointing straight ahead (+z axis) HALF_PI is to the right (+x axis) PI is backwards (-z axis) 1.5*PI is to the left (-x axis) -
elevation
public float elevationAngle of this point between the y-value and the x-z plane 0 is flat HALF_PI is upwards (+y axis) -HALF_PI is downwards (-y axis) -
xn
public float xnNormalized position of point in x-space (0-1); -
yn
public float ynNormalized position of point in y-space (0-1); -
zn
public float znNormalized position of point in z-space (0-1); -
rn
public float rnNormalized position of point in radial space (0-1), 0 is origin, 1 is max radius -
rcn
public float rcnNormalized position of point in radial space from center of model, 0 is center, 1 is point with max radius from center -
xnormal
public float xnormalNormal vector x in direction this light points (optional) -
ynormal
public float ynormalNormal vector y in direction this light points (optional) -
znormal
public float znormalNormal vector z in direction this light points (optional) -
size
public float sizeCustom size of this point in the UI (defaults to DEFAULT_POINT_SIZE) -
index
public int indexIndex of this point into color buffer
-
-
Constructor Details
-
LXPoint
public LXPoint()Construct an empty point, value 0, 0, 0 -
LXPoint
public LXPoint(float x, float y) Construct a point in 2-d space, z will be 0- Parameters:
x- X-coordinatey- Y-coordinate
-
LXPoint
public LXPoint(float x, float y, float z) Construct a point in 3-d space- Parameters:
x- X-coordinatey- Y-coordinatez- Z-coordinate
-
LXPoint
Construct a copy of another point- Parameters:
that- Point to copy
-
LXPoint
public LXPoint(double x, double y, double z) Construct a point in 3-d space- Parameters:
x- X-coordinatey- Y-coordinatez- Z-coordinate
-
LXPoint
Construct a point in 3-d space based upon a vector- Parameters:
v- LXVector
-
LXPoint
Construct a point from transform- Parameters:
transform- LXTransform stack
-
-
Method Details
-
set
Updates this point to a new x-y-z position- Parameters:
x- X-positiony- Y-positionz- Z-position- Returns:
- this
-
set
Set the x, y, and z values based upon the position of the transform- Parameters:
transform- Transform object- Returns:
- this
-
set
Set the x, y, and z values based upon the position of a transform matrix- Parameters:
matrix- Transform matrix object- Returns:
- this
-
set
Set the x, y, and z values based upon another point multiplied by a transform matrix- Parameters:
matrix- Transform matrix objectthat- Another point object- Returns:
- this
-
set
Set the x, y, and z values based upon another point multiplied by a transform matrix- Parameters:
matrix- Transform matrix objectthat- Another vector object- Returns:
- this
-
set
Sets the values of this point based upon another point- Parameters:
that- Other point to copy into this point- Returns:
- this
-
setX
Sets the X coordinate of the point- Parameters:
x- X-coordinate- Returns:
- this
-
setY
Sets the Y coordinate of the point- Parameters:
y- Y-coordinate- Returns:
- this
-
setZ
Sets the Z coordinate of the point- Parameters:
z- Z-coordinate- Returns:
- this
-
set
Updates the point's meta-coordinates, based upon the x y z values.- Returns:
- this
-
setNormal
Set the normal vector values for this point- Parameters:
xnormal- X normal vector componentynormal- Y normal vector componentznormal- Z normal vector component- Returns:
- this
-
multiply
Multiplies the points coordinates by the given transformation matrix- Parameters:
matrix- Transformation matrix- Returns:
- This point, with updated coordinates
-
xn
Deprecated. -
yn
Deprecated. -
zn
Deprecated.
-