Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- unity()
- rotX(double)
- rotY(double)
- rotZ(double)
- rot(double, double, double)
- rot(Vector3d)
- translate(Vector3d)
- translate(double, double, double)
- translateX(double)
- translateY(double)
- translateZ(double)
- mirror(Plane)
- scale(Vector3d)
- scale(double, double, double)
- scale(double)
- scaleX(double)
- scaleY(double)
- scaleZ(double)
- transform(Vector3d)
- invert()
- transform(Vector3d, double)
- getScale()
- isMirror()
- apply(Transform)
- prepend(Transform)
- toString()
Class Transform
java.lang.Object
eu.mihosoft.vrl.v3d.Transform
Transform. Transformations (translation, rotation, scale) can be applied to
geometrical objects like
Example:
CSG
, Polygon
, Vertex
and
Vector3d
.
This transform class uses the builder pattern to define combined
transformations.Example:
TODO: use quaternions for rotations.// t applies rotation and translation Transform t = Transform.unity().rotX(45).translate(2,1,0);
- Author:
- Michael Hoffer <info@michaelhoffer.de>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionApplies the specified transform to this transform.double
getScale()
Performs an SVD normalization of the underlying matrix to calculate and return the uniform scale factor.invert()
Invert the transformationboolean
isMirror()
Indicates whether this transform performs a mirror operation, i.e., flips the orientation.Applies a mirror operation to this transform.rot
(double x, double y, double z) Applies a rotation operation to this transform.Applies a rotation operation to this transform.rotX
(double angle) Applies rotation operation around the x axis to this transform.rotY
(double angle) Applies rotation operation around the y axis to this transform.rotZ
(double angle) Applies rotation operation around the z axis to this transform.scale
(double s) Applies a scale operation to this transform.scale
(double x, double y, double z) Applies a scale operation to this transform.Applies a scale operation to this transform.scaleX
(double s) Applies a scale operation (x axis) to this transform.scaleY
(double s) Applies a scale operation (y axis) to this transform.scaleZ
(double s) Applies a scale operation (z axis) to this transform.toString()
Applies this transform to the specified vector.Applies this transform to the specified vector.translate
(double x, double y, double z) Applies a translation operation to this transform.Applies a translation operation to this transform.translateX
(double value) Applies a translation operation to this transform.translateY
(double value) Applies a translation operation to this transform.translateZ
(double value) Applies a translation operation to this transform.static Transform
unity()
Returns a new unity transform.
-
Constructor Details
-
Method Details
-
unity
-
rotX
Applies rotation operation around the x axis to this transform.- Parameters:
angle
- angle- Returns:
- this transform
-
rotY
Applies rotation operation around the y axis to this transform.- Parameters:
angle
- angle- Returns:
- this transform
-
rotZ
Applies rotation operation around the z axis to this transform.- Parameters:
angle
- angle- Returns:
- this transform
-
rot
Applies a rotation operation to this transform.- Parameters:
x
- x axis rotation (angle)y
- y axis rotation (angle)z
- z axis rotation (angle)- Returns:
- this transform
-
rot
-
translate
-
translate
Applies a translation operation to this transform.- Parameters:
x
- translation (x axis)y
- translation (y axis)z
- translation (z axis)- Returns:
- this transform
-
translateX
Applies a translation operation to this transform.- Parameters:
value
- translation (x axis)- Returns:
- this transform
-
translateY
Applies a translation operation to this transform.- Parameters:
value
- translation (y axis)- Returns:
- this transform
-
translateZ
Applies a translation operation to this transform.- Parameters:
value
- translation (z axis)- Returns:
- this transform
-
mirror
-
scale
-
scale
Applies a scale operation to this transform.- Parameters:
x
- x scale valuey
- y scale valuez
- z scale value- Returns:
- this transform
-
scale
Applies a scale operation to this transform.- Parameters:
s
- s scale value (x, y and z)- Returns:
- this transform
-
scaleX
Applies a scale operation (x axis) to this transform.- Parameters:
s
- x scale value- Returns:
- this transform
-
scaleY
Applies a scale operation (y axis) to this transform.- Parameters:
s
- y scale value- Returns:
- this transform
-
scaleZ
Applies a scale operation (z axis) to this transform.- Parameters:
s
- z scale value- Returns:
- this transform
-
transform
-
invert
-
transform
-
getScale
public double getScale()Performs an SVD normalization of the underlying matrix to calculate and return the uniform scale factor. If the matrix has non-uniform scale factors, the largest of the x, y, and z scale factors distill be returned. Note: this transformation is not modified.- Returns:
- the scale factor of this transformation
-
isMirror
public boolean isMirror()Indicates whether this transform performs a mirror operation, i.e., flips the orientation.- Returns:
true
if this transform performs a mirror operation;false
otherwise
-
apply
-
prepend
-
toString
-