Class RenderViewBase.Matrix

  • Enclosing class:
    RenderViewBase

    public class RenderViewBase.Matrix
    extends java.lang.Object
    This matrix class is used for 3D object rotate along a specifid axis. Also, the rotation is based on the 3D object's location.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      float[][] element
      Matrix element array.
    • Constructor Summary

      Constructors 
      Constructor Description
      Matrix()
      Constructor to create identity matrix.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      RenderViewBase.Matrix inverse()
      Inverse the matrix this.m = inverse(m);
      void multiply​(RenderViewBase.Matrix m)
      Matrix multiplication, row based. this.m = this.m * m
      void print()
      Print out the matrix.
      void reset()
      Identity matrix setup.
      void rotate​(javax.vecmath.Vector3f point, javax.vecmath.Vector3f axis, int angle)
      rotate along a given axis, point and rotation angle.
      void rotatex​(float sin, float cos)
      rotate along x axis with given sin, cos value of the rotatino angle.
      void rotatex​(int degree)
      rotate along x axis with given rotation angle in degree.
      void rotatey​(float sin, float cos)
      Rotate along the y axis with given sin, cos value of the rotation angle.
      void rotatey​(int degree)
      rotate along y axis with given rotation angle in degree.
      void rotatez​(float sin, float cos)
      Rotate along the z axis with given sin, cos value of the rotation angle.
      void rotatez​(int degree)
      rotate along z axis with given rotation angle in degree.
      void scale​(float f)
      Scale the matrix along the diagonal.
      void translate​(float x, float y, float z)
      Translate the matrix to the specified x, y, z postion.
      void translate​(javax.vecmath.Vector3f vec)
      Translate the matrix to the given vector postion.
      • Methods inherited from class java.lang.Object

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

      • element

        public float[][] element
        Matrix element array.
    • Constructor Detail

      • Matrix

        public Matrix()
        Constructor to create identity matrix.
    • Method Detail

      • inverse

        public RenderViewBase.Matrix inverse()
        Inverse the matrix this.m = inverse(m);
        Returns:
        Matrix inverse matrix
      • multiply

        public void multiply​(RenderViewBase.Matrix m)
        Matrix multiplication, row based. this.m = this.m * m
        Parameters:
        m - Matrix
      • print

        public void print()
        Print out the matrix.
      • reset

        public void reset()
        Identity matrix setup.
      • rotate

        public void rotate​(javax.vecmath.Vector3f point,
                           javax.vecmath.Vector3f axis,
                           int angle)
        rotate along a given axis, point and rotation angle.
        Parameters:
        point - Vector3f rotation axis
        axis - Vector3f rotation reference point
        angle - in degree.
      • rotatex

        public void rotatex​(int degree)
        rotate along x axis with given rotation angle in degree.
        Parameters:
        degree - int
      • rotatex

        public void rotatex​(float sin,
                            float cos)
        rotate along x axis with given sin, cos value of the rotatino angle.
        Parameters:
        sin - float
        cos - float
      • rotatey

        public void rotatey​(int degree)
        rotate along y axis with given rotation angle in degree.
        Parameters:
        degree - int
      • rotatey

        public void rotatey​(float sin,
                            float cos)
        Rotate along the y axis with given sin, cos value of the rotation angle.
        Parameters:
        sin - float
        cos - float
      • rotatez

        public void rotatez​(int degree)
        rotate along z axis with given rotation angle in degree.
        Parameters:
        degree - int
      • rotatez

        public void rotatez​(float sin,
                            float cos)
        Rotate along the z axis with given sin, cos value of the rotation angle.
        Parameters:
        sin - float
        cos - float
      • scale

        public void scale​(float f)
        Scale the matrix along the diagonal.
        Parameters:
        f - scale factor.
      • translate

        public void translate​(javax.vecmath.Vector3f vec)
        Translate the matrix to the given vector postion.
        Parameters:
        vec - Vector3f
      • translate

        public void translate​(float x,
                              float y,
                              float z)
        Translate the matrix to the specified x, y, z postion.
        Parameters:
        x - float
        y - float
        z - float