Class LXPoint

java.lang.Object
heronarts.lx.model.LXPoint
Direct Known Subclasses:
GridModel.Point

public class LXPoint extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    float
    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 buffer
    float
    Radius of this point from the origin (0, 0, 0) in 3 dimensions
    float
    Radius of this point from the center of the global model
    float
    Normalized position of point in radial space from center of model, 0 is center, 1 is point with max radius from center
    float
    Normalized position of point in radial space (0-1), 0 is origin, 1 is max radius
    float
    Radius of this point from origin (0, 0) in the x-y plane
    float
    Radius of this point from origin (0, 0) in the x-z plane
    float
    Angle of this point about the origin (0, 0) in the x-y plane
    float
    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

    Constructors
    Constructor
    Description
    Construct an empty point, value 0, 0, 0
    LXPoint(double x, double y, double z)
    Construct a point in 3-d space
    LXPoint(float x, float y)
    Construct a point in 2-d space, z will be 0
    LXPoint(float x, float y, float z)
    Construct a point in 3-d space
    Construct a copy of another point
    LXPoint(LXTransform transform)
    Construct a point from transform
    Construct a point in 3-d space based upon a vector
  • Method Summary

    Modifier and Type
    Method
    Description
    Multiplies the points coordinates by the given transformation matrix
    protected 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 position
    set(LXPoint that)
    Sets the values of this point based upon another point
    set(LXMatrix matrix)
    Set the x, y, and z values based upon the position of a transform matrix
    set(LXMatrix matrix, LXPoint that)
    Set the x, y, and z values based upon another point multiplied by a transform matrix
    set(LXMatrix matrix, LXVector that)
    Set the x, y, and z values based upon another point multiplied by a transform matrix
    set(LXTransform transform)
    Set the x, y, and z values based upon the position of the transform
    setX(float x)
    Sets the X coordinate of the point
    setY(float y)
    Sets the Y coordinate of the point
    setZ(float z)
    Sets the Z coordinate of the point

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • x

      public float x
      X coordinate of this point (absolute)
    • y

      public float y
      Y coordinate of this point (absolute)
    • z

      public float z
      Z coordinate of this point (absolute)
    • r

      public float r
      Radius of this point from the origin (0, 0, 0) in 3 dimensions
    • rc

      public float rc
      Radius of this point from the center of the global model
    • rxy

      public float rxy
      Radius of this point from origin (0, 0) in the x-y plane
    • rxz

      public float rxz
      Radius of this point from origin (0, 0) in the x-z plane
    • theta

      public float theta
      Angle of this point about the origin (0, 0) in the x-y plane
    • azimuth

      public float azimuth
      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)
    • elevation

      public float elevation
      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)
    • xn

      public float xn
      Normalized position of point in x-space (0-1);
    • yn

      public float yn
      Normalized position of point in y-space (0-1);
    • zn

      public float zn
      Normalized position of point in z-space (0-1);
    • rn

      public float rn
      Normalized position of point in radial space (0-1), 0 is origin, 1 is max radius
    • rcn

      public float rcn
      Normalized position of point in radial space from center of model, 0 is center, 1 is point with max radius from center
    • index

      public int index
      Index 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-coordinate
      y - Y-coordinate
    • LXPoint

      public LXPoint(float x, float y, float z)
      Construct a point in 3-d space
      Parameters:
      x - X-coordinate
      y - Y-coordinate
      z - Z-coordinate
    • LXPoint

      public LXPoint(LXPoint that)
      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-coordinate
      y - Y-coordinate
      z - Z-coordinate
    • LXPoint

      public LXPoint(LXVector v)
      Construct a point in 3-d space based upon a vector
      Parameters:
      v - LXVector
    • LXPoint

      public LXPoint(LXTransform transform)
      Construct a point from transform
      Parameters:
      transform - LXTransform stack
  • Method Details

    • set

      public LXPoint set(float x, float y, float z)
      Updates this point to a new x-y-z position
      Parameters:
      x - X-position
      y - Y-position
      z - Z-position
      Returns:
      this
    • set

      public LXPoint set(LXTransform transform)
      Set the x, y, and z values based upon the position of the transform
      Parameters:
      transform - Transform object
      Returns:
      this
    • set

      public LXPoint set(LXMatrix matrix)
      Set the x, y, and z values based upon the position of a transform matrix
      Parameters:
      matrix - Transform matrix object
      Returns:
      this
    • set

      public LXPoint set(LXMatrix matrix, LXPoint that)
      Set the x, y, and z values based upon another point multiplied by a transform matrix
      Parameters:
      matrix - Transform matrix object
      that - Another point object
      Returns:
      this
    • set

      public LXPoint set(LXMatrix matrix, LXVector that)
      Set the x, y, and z values based upon another point multiplied by a transform matrix
      Parameters:
      matrix - Transform matrix object
      that - Another vector object
      Returns:
      this
    • set

      public LXPoint set(LXPoint that)
      Sets the values of this point based upon another point
      Parameters:
      that - Other point to copy into this point
      Returns:
      this
    • setX

      public LXPoint setX(float x)
      Sets the X coordinate of the point
      Parameters:
      x - X-coordinate
      Returns:
      this
    • setY

      public LXPoint setY(float y)
      Sets the Y coordinate of the point
      Parameters:
      y - Y-coordinate
      Returns:
      this
    • setZ

      public LXPoint setZ(float z)
      Sets the Z coordinate of the point
      Parameters:
      z - Z-coordinate
      Returns:
      this
    • set

      protected LXPoint set()
      Updates the point's meta-coordinates, based upon the x y z values.
      Returns:
      this
    • multiply

      public LXPoint multiply(LXMatrix matrix)
      Multiplies the points coordinates by the given transformation matrix
      Parameters:
      matrix - Transformation matrix
      Returns:
      This point, with updated coordinates