|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.freehep.graphics3d.Transform3D
Taken from Graphics Gems (page 476 and 770).
Field Summary | |
protected Matrix4 |
m
|
protected Stack |
transforms
|
protected boolean |
valid
|
Constructor Summary | |
Transform3D()
|
Method Summary | |
Vector3 |
deltaInverseTransform(double du,
double dv,
double dw,
Vector3 dxyz)
returns the world distance of a pixel distance by applying the inverse transform, but without using the translation part |
boolean |
equals(Object object)
|
void |
frustum(double left,
double right,
double bottom,
double top,
double near,
double far)
Creates a perspective projection. |
double[][] |
get(double[] x,
double[] y,
double[] z,
double[][] result)
Transforms array of points into double array. |
double[] |
get(double x,
double y,
double z,
double[] result)
Transforms point into double array. |
double[] |
get(double x,
double y,
double z,
double x0,
double y0,
double width,
double height,
double[] result)
Applies matrix transform and viewport functions. |
double[][] |
get(Polyline3 poly,
double[][] result)
Transforms Polyline3 into double array. |
int[][] |
get(Polyline3 poly,
int x0,
int y0,
int width,
int height,
int[][] result)
Applies matrix transform and viewport functions. |
Matrix4 |
getMatrix()
Returns current transform. |
Vector3 |
getTranslate(Vector3 v)
|
double |
getU(double x,
double y,
double z)
Return U coordinate. |
double |
getV(double x,
double y,
double z)
Return V coordinate. |
double |
getW(double x,
double y,
double z)
Return W coordinate. |
int |
hashCode()
|
void |
multiply(Matrix4 matrix)
Multiply transform matrix by matrix. |
void |
ortho(double left,
double right,
double bottom,
double top,
double near,
double far)
Creates a parallel projection. |
void |
pop()
Pops the top transform off the stack. |
void |
push()
Pushes a copy of this transform on the stack. |
void |
rotate(double ux,
double uy,
double uz,
double theta)
Rotates over unit vector ux,uy,uz by angle theta (in radiants). |
void |
scale(double sx,
double sy,
double sz)
Scales the model non-uniformly along the x, y and z-axes. |
void |
setMatrix(Matrix4 matrix)
Set transform matrix to matrix. |
String |
toString()
|
void |
translate(double tx,
double ty,
double tz)
|
void |
translateModel(double tx,
double ty,
double tz)
Translates the current transform. |
protected void |
validate()
Validates the current transform and extracts its parameters. |
void |
zoom(double sx,
double sy,
double sz)
Zooms the user non-uniformly along the x, y and z-axes. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Stack transforms
protected Matrix4 m
protected boolean valid
Constructor Detail |
public Transform3D()
Method Detail |
public void push()
public void pop()
public double[] get(double x, double y, double z, double x0, double y0, double width, double height, double[] result)
xw = (xn + 1) * width / 2 + x0; yw = height - (yn + 1) * height / 2 + y0;
public int[][] get(Polyline3 poly, int x0, int y0, int width, int height, int[][] result)
xw = (xn + 1) * width / 2 + x0; yw = height - (yn + 1) * height / 2 + y0;
public double[][] get(Polyline3 poly, double[][] result)
public double[][] get(double[] x, double[] y, double[] z, double[][] result)
public double[] get(double x, double y, double z, double[] result)
public double getU(double x, double y, double z)
public double getV(double x, double y, double z)
public double getW(double x, double y, double z)
public Vector3 deltaInverseTransform(double du, double dv, double dw, Vector3 dxyz) throws NoninvertibleTransformException
NoninvertibleTransformException
public void scale(double sx, double sy, double sz)
m00 m01 m02 m03 sx 0 0 0 m10 m11 m12 m13 0 sy 0 0 m20 m21 m22 m23 0 0 sz 0 m30 m31 m32 m33 0 0 0 1
public void zoom(double sx, double sy, double sz)
sx 0 0 0 m00 m01 m02 m03 0 sy 0 0 m10 m11 m12 m13 0 0 sz 0 m20 m21 m22 m23 0 0 0 1 m30 m31 m32 m33
public void translateModel(double tx, double ty, double tz)
m00 m01 m02 m03 1 0 0 tx m10 m11 m12 m13 0 1 0 ty m20 m21 m22 m23 0 0 1 tz m30 m31 m32 m33 0 0 0 1
public void translate(double tx, double ty, double tz)
public void rotate(double ux, double uy, double uz, double theta)
m00 m01 m02 m03 x^2(1-c) + c xy(1-c) - zs xz(1-c) + ys 0 m10 m11 m12 m13 yx(1-c) + zs y^2(1-c) + c yz(1-c) - xs 0 m20 m21 m22 m23 xz(1-c) - ys yz(1-c) + xs z^2(1-c) + c 0 m30 m31 m32 m33 0 0 0 1where c = cos(theta), s = sin(theta) and ||(ux,uy,uz)|| = 1.
public void ortho(double left, double right, double bottom, double top, double near, double far)
m00 m01 m02 m03 2/(right-left) 0 0 -(right+left)/(right-left) m10 m11 m12 m13 0 2/(top-bottom) 0 -(top+bottom)/(top-bottom) m20 m21 m22 m23 0 0 -2/(far-near) -(far+near)/(far-near) m30 m31 m32 m33 0 0 0 1where if denominators are 0 for scaling factors, the scale factor defaults to 1, and if denominators are 0 for translation factors, the translation factor defaults to 0.
public void frustum(double left, double right, double bottom, double top, double near, double far)
m00 m01 m02 m03 2*near/(right-left) 0 (right+left)/(right-left) 0 m10 m11 m12 m13 0 2*near/(top-bottom) (top+bottom)/(top-bottom) 0 m20 m21 m22 m23 0 0 -(far+near)/(far-near) -2*far*near/(far-near) m30 m31 m32 m33 0 0 -1 0where if denominators are 0 for scaling factors, the scale factor defaults to 1, and if denominators are 0 for translation factors, the translation factor defaults to 0.
public void multiply(Matrix4 matrix)
public void setMatrix(Matrix4 matrix)
public Matrix4 getMatrix()
public boolean equals(Object object)
public int hashCode()
public String toString()
protected void validate()
Taken from Graphics Gems II (page 466)
public Vector3 getTranslate(Vector3 v)
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |