|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--a3dAPI.a3dUTIL
This class offers some routines you can find useful when using anfy3dAPI. This class is not needed by any component of anfy3dAPI
| Constructor Summary | |
a3dUTIL()
|
|
| Method Summary | |
static void |
angleAxisToQuat(float[] a,
float[] b)
Convert an angleAxis to a quaternion |
static void |
concatenateMatrix(float[] a,
float[] b,
float[] c)
Concatenates matrices (matrices are 4x3) |
static int[] |
convertToTri(int[] a,
boolean ccw)
convert a common vrml-like vertex index into a triangles vertex index |
static java.lang.Object |
generateNormals(float[] points,
int[] faces,
float angle)
Generate normals for a shape (like in vrml model) then use getNormal() and getNormalI() |
static float[] |
getNormal(java.lang.Object tmp)
returns the normals |
static int[] |
getNormalI(java.lang.Object tmp)
returns the normalsI |
static int[] |
imgGrabber(java.awt.Image img,
int[] aspect)
Grabs pixels from an Image |
static int[] |
imgLoad(java.lang.String imgName,
int[] aspect,
java.awt.Component component)
Loads and grab an image |
static int[] |
imgLoad(java.net.URL imgName,
int[] aspect,
java.awt.Component component)
Loads and grab an image |
static java.awt.Image |
imgWait(java.awt.Image image,
java.awt.Component component)
Waits an image to be loaded |
static void |
invertMatrix(float[] m,
float[] d)
invert a matrix |
static void |
positionMatrix(float x,
float y,
float z,
float[] a)
create a position matrix |
static void |
quatToAngleAxis(float[] a,
float[] b)
Convert a quaternion to an angleAxis |
static void |
rotationMatrix(float rx,
float ry,
float rz,
float rw,
float[] m)
generate a rotation matrix given an axis-angle |
static void |
rotxMatrix(float angle,
float[] a)
rotate around x axis |
static void |
rotyMatrix(float angle,
float[] a)
rotate around y axis |
static void |
rotzMatrix(float angle,
float[] a)
rotate around z axis |
static void |
scaleMatrix(float x,
float y,
float z,
float[] a)
scale matrix |
static void |
slerp(float[] a,
float[] b,
float alpha,
float[] c)
slerp torugh the shortest path |
static void |
transformMatrix(float tx,
float ty,
float tz,
float cx,
float cy,
float cz,
float rx,
float ry,
float rz,
float rw,
float sx,
float sy,
float sz,
float srx,
float sry,
float srz,
float srw,
float[] m,
float[] m1)
generic transformation matrix |
static void |
transposeMatrix(float[] a,
float[] b)
transpose a matrix |
static void |
unitMatrix(float[] a)
initialize a unit matrix |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public a3dUTIL()
| Method Detail |
public static final java.awt.Image imgWait(java.awt.Image image,
java.awt.Component component)
public static final int[] imgLoad(java.net.URL imgName,
int[] aspect,
java.awt.Component component)
imgName - URL of the image to loadaspect - a length 2 array that will be filled with width and heightcomponent - a valid component
public static final int[] imgLoad(java.lang.String imgName,
int[] aspect,
java.awt.Component component)
imgName - name of the image to loadaspect - a length 2 array that will be filled with width and heightcomponent - a valid component
public static final int[] imgGrabber(java.awt.Image img,
int[] aspect)
img - image to grabaspect - an array of length 2 that will be filled with the width of the image (aspect[0])
and the height of the image (aspect[1])
public static final void concatenateMatrix(float[] a,
float[] b,
float[] c)
a - start matrixb - matrix to concatenate toc - destination matrixpublic static final void unitMatrix(float[] a)
a - 4x3 matrix to initialize to unit matrix
public static final void rotationMatrix(float rx,
float ry,
float rz,
float rw,
float[] m)
rx - angleaxis xry - angleaxis yrz - angleaxis zrw - angleaxis anglem - destination matrix
public static final void transposeMatrix(float[] a,
float[] b)
a - matrix to transposeb - destination matrix
public static final void invertMatrix(float[] m,
float[] d)
a - matrix to transposeb - destination matrix
public static final void transformMatrix(float tx,
float ty,
float tz,
float cx,
float cy,
float cz,
float rx,
float ry,
float rz,
float rw,
float sx,
float sy,
float sz,
float srx,
float sry,
float srz,
float srw,
float[] m,
float[] m1)
tx - x positionty - y positiontz - z positioncx - center xcy - center ycz - center zrx - angleaxis xry - angleaxis yrz - angleaxis zrw - angleaxis anglesx - scale xsy - scale ysz - scale zsrx - scale angleaxis xsry - scale angleaxis ysrz - scale angleaxis zsrw - scale angleaxis anglem - destination matrixm1 - temp matrix
public static final void positionMatrix(float x,
float y,
float z,
float[] a)
a - matrix to initialize to translation matrixx - x positiony - y positionz - z position
public static final void scaleMatrix(float x,
float y,
float z,
float[] a)
a - matrix to initialize to scale matrixx - scale xy - scale yz - scale z
public static final void rotxMatrix(float angle,
float[] a)
angle - angle in radiansa - matrix to initialize to x rotation
public static final void rotyMatrix(float angle,
float[] a)
angle - angle in radiansa - matrix to initialize to y rotation
public static final void rotzMatrix(float angle,
float[] a)
angle - angle in radiansa - matrix to initialize to z rotation
public static final int[] convertToTri(int[] a,
boolean ccw)
a - an array of integers representing a coordIndex in vrml97 formatccw - order of this face edges
public static final java.lang.Object generateNormals(float[] points,
int[] faces,
float angle)
angle - creaseAngle (in radians)points - array of pointsfaces - array of point indicespublic static final float[] getNormal(java.lang.Object tmp)
tmp - the Object returned from generateNormals()public static final int[] getNormalI(java.lang.Object tmp)
tmp - the Object returned from generateNormals()
public static final void angleAxisToQuat(float[] a,
float[] b)
a - source angleAxis (a 4 float array [x,y,z,angle])b - destination quaternion (a 4 float array [x,y,z,w])
public static final void quatToAngleAxis(float[] a,
float[] b)
a - source quaternion (a 4 float array [x,y,z,w])b - destination angleAxis (a 4 float array [x,y,z,angle])
public static final void slerp(float[] a,
float[] b,
float alpha,
float[] c)
a - starting quaternionb - ending quaternionalpha - alpha valuec - destination quaternion
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||