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
Modifier and TypeFieldDescriptionfloat
Angle 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)float
Angle 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)int
Index of this point into color bufferfloat
Radius of this point from the origin (0, 0, 0) in 3 dimensionsfloat
Radius of this point from the center of the global modelfloat
Normalized position of point in radial space from center of model, 0 is center, 1 is point with max radius from centerfloat
Normalized position of point in radial space (0-1), 0 is origin, 1 is max radiusfloat
Radius of this point from origin (0, 0) in the x-y planefloat
Radius of this point from origin (0, 0) in the x-z planefloat
Angle of this point about the origin (0, 0) in the x-y planefloat
X coordinate of this point (absolute)float
Normalized position of point in x-space (0-1);float
Y coordinate of this point (absolute)float
Normalized position of point in y-space (0-1);float
Z coordinate of this point (absolute)float
Normalized position of point in z-space (0-1); -
Constructor Summary
ConstructorDescriptionLXPoint()
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 LXPoint
set()
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 transformsetX
(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 point
-
Field Details
-
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 global 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 -
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
-
multiply
Multiplies the points coordinates by the given transformation matrix- Parameters:
matrix
- Transformation matrix- Returns:
- This point, with updated coordinates
-