|
CubeTwister 2.0alpha142 2012-02-11 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.randelshofer.beans.AbstractStateModel ch.randelshofer.geom3d.RotatedTransform3DModel
public class RotatedTransform3DModel
This model wraps another Transform3DModel. All changes are propagated to the wrapped model. The Transform3D returned by the getTransformModels is concatenated with the rotation specified in the constructor of the model.
Field Summary |
---|
Fields inherited from class ch.randelshofer.beans.AbstractStateModel |
---|
changeEvent, listenerList |
Constructor Summary | |
---|---|
RotatedTransform3DModel(double dx,
double dy,
double dz)
Creates a new instance of ConcatenatedTransform3DModel |
|
RotatedTransform3DModel(double dx,
double dy,
double dz,
Transform3DModel m)
|
Method Summary | |
---|---|
void |
concatenate(Transform3D t)
Concatenates a transform Tx to this transform Cx. |
Transform3D |
getTransform()
Returns the current state of the model. |
Transform3D |
getTransform(Transform3D t)
Copies the current state of the model into the given Transform3D object and returns it. |
void |
rotate(double rx,
double ry,
double rz)
Concatenates this transform with a rotation transformation. |
void |
rotateX(double rx)
Concatenates this transform with a rotation transformation. |
void |
rotateY(double ry)
Concatenates this transform with a rotation transformation. |
void |
rotateZ(double rz)
Concatenates this transform with a rotation transformation. |
void |
scale(double sx,
double sy,
double sz)
Concatenates this transform with a scaling transformation. |
void |
setModel(Transform3DModel m)
|
void |
setToIdentity()
Resets this transform to the Identity transform. |
void |
setTransform(Transform3D t)
Sets this transform to a copy of the transform in the specified Transform3D object. |
void |
stateChanged(javax.swing.event.ChangeEvent changeEvent)
|
void |
translate(double tx,
double ty,
double tz)
Concatenates this transform with a translation transformation. |
Methods inherited from class ch.randelshofer.beans.AbstractStateModel |
---|
addChangeListener, fireStateChanged, removeChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ch.randelshofer.geom3d.Transform3DModel |
---|
addChangeListener, removeChangeListener |
Constructor Detail |
---|
public RotatedTransform3DModel(double dx, double dy, double dz)
public RotatedTransform3DModel(double dx, double dy, double dz, Transform3DModel m)
Method Detail |
---|
public void setModel(Transform3DModel m)
public void concatenate(Transform3D t)
[this] = [this] x [Tx]
concatenate
in interface Transform3DModel
t
- The transform object to be concatenated with
this transform object.public Transform3D getTransform()
getTransform
in interface Transform3DModel
public Transform3D getTransform(Transform3D t)
getTransform
in interface Transform3DModel
public void rotate(double rx, double ry, double rz)
[ cos(rz)*cos(ry) cos(rz)*sin(ry)*sin(rx) cos(rz)*-sin(ry)*cos(rx) 0 ] +sin(rz)*cos(rx) +sin(rz)*-sin(ry)*cos(rx) [ -sin(rz)*cos(ry) -sin(rz)*sin(ry)*sin(rx) -sin(rz)*-sin(ry)*cos(rx) 0 ] +cos(rz)*cos(rx) +cos(rz)*sin(rx) [ sin(ry) cos(ry)*-sin(rx) cos(ry)*cos(rx) 0 ] [ 0 0 0 1 ]Positive values rotate counterclockwise.
rotate
in interface Transform3DModel
rx
- Rotation along the x axis in radians.ry
- Rotation along the y axis in radians.rz
- Rotation along the z axis in radians.public void rotateX(double rx)
[ 1 0 0 0 ] [ 0 cos(rx) sin(rx) 0 ] [ 0 -sin(rx) cos(rx) 0 ] [ 0 0 0 1 ]Positive values rotate counterclockwise.
rotateX
in interface Transform3DModel
rx
- Rotation along the x axis in radians.public void rotateY(double ry)
[ cos(ry) 0 -sin(ry) 0 ] [ 0 1 0 0 ] [ sin(ry) 0 cos(ry) 0 ] [ 0 0 0 1 ]Positive values rotate counterclockwise.
rotateY
in interface Transform3DModel
ry
- Rotation along the y axis in radians.public void rotateZ(double rz)
[ cos(rz) sin(rz) 0 0 ] [ -sin(rz) cos(rz) 0 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ]Positive values rotate counterclockwise.
rotateZ
in interface Transform3DModel
rz
- Rotation along the z axis in radians.public void scale(double sx, double sy, double sz)
[ sx 0 0 0 ] [ 0 sy 0 0 ] [ 0 0 sz 0 ] [ 0 0 0 1 ]
scale
in interface Transform3DModel
public void setToIdentity()
setToIdentity
in interface Transform3DModel
public void setTransform(Transform3D t)
Transform3D
object.
setTransform
in interface Transform3DModel
t
- the Transform3D
object from which to
copy the transformpublic void translate(double tx, double ty, double tz)
[ 1 0 0 tx ] [ 0 1 0 ty ] [ 0 0 1 tz ] [ 0 0 0 1 ]
translate
in interface Transform3DModel
public void stateChanged(javax.swing.event.ChangeEvent changeEvent)
stateChanged
in interface javax.swing.event.ChangeListener
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |