Class LXProjection

java.lang.Object
heronarts.lx.transform.LXProjection
All Implemented Interfaces:
Iterable<LXVector>

public class LXProjection extends Object implements Iterable<LXVector>
Class to compute projections of an entire model. These are applied cheaply by using direct manipulation rather than matrix multiplication. No push or pop is available.
  • Constructor Details

    • LXProjection

      public LXProjection(LXModel model)
      Constructs a projection view of the given model
      Parameters:
      model - Model
  • Method Details

    • iterator

      public Iterator<LXVector> iterator()
      Specified by:
      iterator in interface Iterable<LXVector>
    • reset

      public LXProjection reset()
      Reset all points in the projection to the model
      Returns:
      this, for method chaining
    • scale

      public LXProjection scale(float sx, float sy, float sz)
      Scales the projection
      Parameters:
      sx - x-factor
      sy - y-factor
      sz - z-factor
      Returns:
      this, for method chaining
    • translate

      public LXProjection translate(float tx, float ty, float tz)
      Translates the projection
      Parameters:
      tx - x-translation
      ty - y-translation
      tz - z-translation
      Returns:
      this, for method chaining
    • center

      public LXProjection center()
      Centers the projection, by translating it such that the origin (0, 0, 0) becomes the center of the model
      Returns:
      this, for method chaining
    • translateCenter

      public LXProjection translateCenter(float tx, float ty, float tz)
      Translates the model from its center, so (0, 0, 0) becomes (tx, ty, tz)
      Parameters:
      tx - x-translation
      ty - y-translation
      tz - z-translation
      Returns:
      this, for method chaining
    • reflectX

      public LXProjection reflectX()
      Reflects the projection about the x-axis
      Returns:
      this, for method chaining
    • reflectY

      public LXProjection reflectY()
      Reflects the projection about the y-axis
      Returns:
      this, for method chaining
    • reflectZ

      public LXProjection reflectZ()
      Reflects the projection about the z-axis
      Returns:
      this, for method chaining
    • rotate

      public LXProjection rotate(float angle, float l, float m, float n)
      Rotates the projection about a vector
      Parameters:
      angle - Angle to rotate by, in radians
      l - vector x-value
      m - vector y-value
      n - vector z-value
      Returns:
      this, for method chaining
    • rotateX

      public LXProjection rotateX(float angle)
      Rotate about the x-axis
      Parameters:
      angle - Angle in radians
      Returns:
      this
    • rotateY

      public LXProjection rotateY(float angle)
      Rotate about the x-axis
      Parameters:
      angle - Angle in radians
      Returns:
      this
    • rotateZ

      public LXProjection rotateZ(float angle)
      Rotate about the x-axis
      Parameters:
      angle - Angle in radians
      Returns:
      this