|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteinshader.math.LocalFrame
public class LocalFrame
Stores a local coordinate frame as a rotation (a Quaternion) and a
translation (a Point3d).
In order to render a region of secondary structure (a Helix,
BetaStrand, or Loop), a waist polygon will be swept along a spline
(a curved line formed by piecewise cubic equations). At each control
point along the spline, a local coordinate frame (a rotation and an
xyz-translation) will be used to correctly position the waist polygon.
| Constructor Summary | |
|---|---|
LocalFrame()
Constructs a LocalFrame with the identity quaternion, (0, 0, 0, 1) and a translation of (0, 0, 0). |
|
LocalFrame(double qX,
double qY,
double qZ,
double qW,
double x,
double y,
double z)
Constructs a LocalFrame using the rotation and translation given as arguments. |
|
LocalFrame(Quaternion rotation,
Vec3d translation)
Constructs a LocalFrame that holds on to the Quaternion and Vec3d given as arguments. |
|
LocalFrame(Vec3d N,
Vec3d B,
Vec3d T,
double x,
double y,
double z)
Constructs a LocalFrame equivalent to the rotation matrix [N B T] and the translation (x, y, z). |
|
| Method Summary | |
|---|---|
LocalFrame |
clone()
Returns a clone of the calling LocalFrame. |
void |
generateMatrix(Vec3d N,
Vec3d B,
Vec3d T)
Generates a 3 x 3 rotation matrix (actually 3 column vectors) that is equivalent to the rotation quaternion. |
Vec3d |
getBinormal()
Converts the rotation (a Quaternion) into a 3 x 3 rotation matrix and the returns the second column vector (the Binormal). |
Vec3d |
getNormal()
Converts the rotation (a Quaternion) into a 3 x 3 rotation matrix and the returns the first column vector (the Normal). |
Vec3d |
getReverseTangent()
Converts the rotation (a Quaternion) into a 3 x 3 rotation matrix and the returns the third column vector (the Tangent) after reversing its direction. |
Vec3d |
getTangent()
Converts the rotation (a Quaternion) into a 3 x 3 rotation matrix and the returns the third column vector (the Tangent). |
Vec3d |
getTranslation()
Returns a copy of the translation vector held by this LocalFrame. |
Point3d |
multiply(Point3d vertex)
Multiplies the vertex by the local frame. |
Point3d |
rotate(Point3d point)
Returns a new point produced by rotating the point given as an argument by the quaternion held in this local frame. |
Vec3d |
rotate(Vec3d vector)
Returns a new vector produced by rotating the vector given as an argument by the quaternion held in this local frame. |
void |
setRotation(double x,
double y,
double z,
double w)
Set the rotation to the quaternion xyzw-values given as arguments. |
void |
setRotation(Quaternion rotation)
Holds on to the Quaternion given as an argument so that it can be used as the rotation of the local coordinate frame. |
void |
setTranslation(double x,
double y,
double z)
Set the translation to the xyz-values given as arguments. |
void |
setTranslation(Vec3d translation)
Holds on the the vector given as an argument so that it can be used as the translation for the local coordinate frame. |
String |
toString()
As a convenience for debugging, the toString() method returns the xyzw-components of the quaternion and the translation vector in the form "{ (x, y, z, w), (x, y, z) }". |
void |
translate(Point3d vertex)
The vertex given as an argument is modified by adding to it the xyz-coordinates of the translation vector held by this LocalFrame. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LocalFrame()
public LocalFrame(Vec3d N,
Vec3d B,
Vec3d T,
double x,
double y,
double z)
N - the normal (3rd column vector of a rotation matrix).B - the binormal (2nd column vector of a rotation matrix).T - the tangent (1st column vector of a rotation matrix).x - the x-coordinate of a translation.y - the y-coordinate of a translation.z - the z-coordinate of a translation.
public LocalFrame(Quaternion rotation,
Vec3d translation)
rotation - the quaternion equivalent to a rotation matrix.translation - an (x, y, z) translation.
public LocalFrame(double qX,
double qY,
double qZ,
double qW,
double x,
double y,
double z)
qX - the x-value of the rotation quaternion.qY - the y-value of the rotation quaternion.qZ - the z-value of the rotation quaternion.qW - the w-value of the rotation quaternion.x - the x-coordinate of a translation.y - the y-coordinate of a translation.z - the z-coordinate of a translation.| Method Detail |
|---|
public LocalFrame clone()
clone in class Object
public void generateMatrix(Vec3d N,
Vec3d B,
Vec3d T)
N - a normal vector (N.x, N.y, N.z) to fill with values.B - a binormal vector (B.x, B.y, B.z) to fill with values.T - a tangent vector (T.x, T.y, T.z) to fill with values.public Vec3d getNormal()
public Vec3d getBinormal()
public Vec3d getTangent()
public Vec3d getReverseTangent()
public Vec3d getTranslation()
public Point3d multiply(Point3d vertex)
vertex - a vertex of a waist polygon.
public Point3d rotate(Point3d point)
point - the point to rotate
public Vec3d rotate(Vec3d vector)
vector - the vector to rotate.
public void translate(Point3d vertex)
vertex - the vertex of a waist polygon.
public void setRotation(double x,
double y,
double z,
double w)
x - the x-coordinate for the quaternion.y - the y-coordinate for the quaternion.z - the z-coordinate for the quaternion.w - the w-coordinate for the quaternion.public void setRotation(Quaternion rotation)
rotation - a rotation in the form of a Quaternion.
public void setTranslation(double x,
double y,
double z)
x - the x-coordinate for the translation.y - the y-coordinate for the translation.z - the z-coordinate for the translation.public void setTranslation(Vec3d translation)
translation - the translation vector.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||