Package gov.nih.mipav.view.renderer.J3D
Class RenderViewBase.Matrix
- java.lang.Object
-
- gov.nih.mipav.view.renderer.J3D.RenderViewBase.Matrix
-
- Enclosing class:
- RenderViewBase
public class RenderViewBase.Matrix extends java.lang.ObjectThis 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[][]elementMatrix 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.Matrixinverse()Inverse the matrix this.m = inverse(m);voidmultiply(RenderViewBase.Matrix m)Matrix multiplication, row based. this.m = this.m * mvoidprint()Print out the matrix.voidreset()Identity matrix setup.voidrotate(javax.vecmath.Vector3f point, javax.vecmath.Vector3f axis, int angle)rotate along a given axis, point and rotation angle.voidrotatex(float sin, float cos)rotate along x axis with given sin, cos value of the rotatino angle.voidrotatex(int degree)rotate along x axis with given rotation angle in degree.voidrotatey(float sin, float cos)Rotate along the y axis with given sin, cos value of the rotation angle.voidrotatey(int degree)rotate along y axis with given rotation angle in degree.voidrotatez(float sin, float cos)Rotate along the z axis with given sin, cos value of the rotation angle.voidrotatez(int degree)rotate along z axis with given rotation angle in degree.voidscale(float f)Scale the matrix along the diagonal.voidtranslate(float x, float y, float z)Translate the matrix to the specified x, y, z postion.voidtranslate(javax.vecmath.Vector3f vec)Translate the matrix to the given vector postion.
-
-
-
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 axisaxis- Vector3f rotation reference pointangle- 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- floatcos- 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- floatcos- 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- floatcos- 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- floaty- floatz- float
-
-