lt.monarch.chart.chart3D.engine
Class Transformation3D

java.lang.Object
  extended by lt.monarch.chart.chart3D.engine.Transformation3D

public class Transformation3D
extends java.lang.Object

Transforms the coordinates according to the rotation and elevation


Constructor Summary
Constructor and Description
Transformation3D()
          Constructs an instance of Transformation3D with neutral matrix.
Transformation3D(double[][] matrix)
          Constructs an instance of Transformation3D with already prepared matrix
Transformation3D(double xScale, double yScale, double zScale, double xShift, double yShift, double zShift, double xRotation, double yRotation, double zRotation)
          Constructs an instance of Transformation3D with some parameters specified.
 
Method Summary
Modifier and Type Method and Description
 double getXRotation()
          Retrieves rotation angle about x axis.
 double getXScale()
          Retrieves scaling value along x axis.
 double getYRotation()
          Retrieves rotation angle about y axis.
 double getYScale()
          Retrieves scaling value along y axis.
 double getZRotation()
          Retrieves rotation angle about z axis.
 double getZScale()
          Retrieves scaling value along z axis.
 Point3D transform(Point3D vectorPoint, double x, double y, double z)
          Transforms the point according to transformation matrix
 Point3D transform(Point3D vectorPoint, Point3D anchor)
          Transforms the point according to transformation matrix
 void transformInplace(Point3D vectorPoint, double x, double y, double z)
          Transforms the point according to transformation matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transformation3D

public Transformation3D()
Constructs an instance of Transformation3D with neutral matrix.


Transformation3D

public Transformation3D(double[][] matrix)
Constructs an instance of Transformation3D with already prepared matrix

Parameters:
matrix - Prepared/filled matrix

Transformation3D

public Transformation3D(double xScale,
                        double yScale,
                        double zScale,
                        double xShift,
                        double yShift,
                        double zShift,
                        double xRotation,
                        double yRotation,
                        double zRotation)
Constructs an instance of Transformation3D with some parameters specified.

Parameters:
xScale - scaling along x axis
yScale - scaling along y axis
zScale - scaling along z axis
xShift - a shift along x axis
yShift - a shift along y axis
zShift - a shift along z axis
xRotation - rotation about x axis in degrees
yRotation - rotation about y axis in degrees
zRotation - rotation about z axis in degrees
Method Detail

getXRotation

public double getXRotation()
Retrieves rotation angle about x axis.

Returns:
rotation angle in radians

getYRotation

public double getYRotation()
Retrieves rotation angle about y axis.

Returns:
rotation angle in radians

getZRotation

public double getZRotation()
Retrieves rotation angle about z axis.

Returns:
rotation angle in radians

getXScale

public double getXScale()
Retrieves scaling value along x axis.

Returns:
scaling factor

getYScale

public double getYScale()
Retrieves scaling value along y axis.

Returns:
scaling factor

getZScale

public double getZScale()
Retrieves scaling value along z axis.

Returns:
scaling factor

transform

public Point3D transform(Point3D vectorPoint,
                         double x,
                         double y,
                         double z)
Transforms the point according to transformation matrix

Parameters:
vectorPoint - the point to transform
x - x anchor point
y - y anchor point
z - z anchor point
Returns:
transformed point

transformInplace

public void transformInplace(Point3D vectorPoint,
                             double x,
                             double y,
                             double z)
Transforms the point according to transformation matrix. Points values are replaced with transformed values.

Parameters:
vectorPoint - the point to transform
x - x anchor point
y - y anchor point
z - z anchor point

transform

public Point3D transform(Point3D vectorPoint,
                         Point3D anchor)
Transforms the point according to transformation matrix

Parameters:
vectorPoint - the point to transform
anchor - anchor point
Returns:
transformed point