本文整理汇总了Java中javax.vecmath.AxisAngle4f类的典型用法代码示例。如果您正苦于以下问题:Java AxisAngle4f类的具体用法?Java AxisAngle4f怎么用?Java AxisAngle4f使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AxisAngle4f类属于javax.vecmath包,在下文中一共展示了AxisAngle4f类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: outputEllipsoid
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
@Override
protected void outputEllipsoid(Point3f center, Point3f[] points, short colix) {
if (debug) {
debugPrint("outputEllipsoid: colix="
+ String.format("%04x", new Short(colix)));
debugPrint(" center=" + center);
debugPrint(" points[0]=" + points[0]);
debugPrint(" points[1]=" + points[1]);
debugPrint(" points[2]=" + points[2]);
}
if (surfacesOnly) {
debugPrint(" Not done owing to surfacesOnly");
return;
}
AxisAngle4f a = Quaternion.getQuaternionFrame(center, points[1], points[3])
.toAxisAngle4f();
float sx = points[1].distance(center);
float sy = points[3].distance(center);
float sz = points[5].distance(center);
outputEllipsoid1(center, sx, sy, sz, a, colix);
}
示例2: outputEllipsoid1
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
/**
* Local implementation of outputEllipsoid.
*
* @param center
* @param rx
* @param ry
* @param rz
* @param a
* @param colix
*/
private void outputEllipsoid1(Point3f center, float rx, float ry, float rz,
AxisAngle4f a, short colix) {
MeshSurface data = MeshData.getSphereData();
addTexture(colix, null);
String name;
if (center instanceof Atom) {
Atom atom = (Atom) center;
name = atom.getAtomName().replaceAll("\\s", "") + "_Atom";
} else if (rx == ry && rx == rz) {
// Is a sphere
name = "Sphere" + sphereNum++;
} else {
name = "Ellipsoid" + ellipsoidNum++;
}
setSphereMatrix(center, rx, ry, rz, a, sphereMatrix);
addMesh(name, data, sphereMatrix, sphereMatrix, colix, null, null);
}
示例3: outputQuaternionFrame
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
protected void outputQuaternionFrame(Point3f ptCenter, Point3f ptX,
Point3f ptY, Point3f ptZ, float yScale,
String pre, String post) {
//Hey, hey -- quaternions to the rescue!
// Just send three points to Quaternion to define a plane and return
// the AxisAngle required to rotate to that position. That's all there is to it.
tempQ1.set(ptX);
tempQ2.set(ptY);
AxisAngle4f a = Quaternion.getQuaternionFrame(ptCenter, tempQ1, tempQ2)
.toAxisAngle4f();
if (!Float.isNaN(a.x)) {
output(" rotation");
output(pre);
output(a.x + " " + a.y + " " + a.z + " " + a.angle);
output(post);
}
float sx = ptX.distance(ptCenter);
float sy = ptY.distance(ptCenter) * yScale;
float sz = ptZ.distance(ptCenter);
output(" scale");
output(pre);
output(sx + " " + sy + " " + sz);
output(post);
}
示例4: setSphereMatrix
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
protected void setSphereMatrix(Point3f center, float rx, float ry, float rz,
AxisAngle4f a, Matrix4f sphereMatrix) {
if (a != null) {
Matrix3f mq = new Matrix3f();
Matrix3f m = new Matrix3f();
m.m00 = rx;
m.m11 = ry;
m.m22 = rz;
mq.set(a);
mq.mul(m);
sphereMatrix.set(mq);
} else {
sphereMatrix.setIdentity();
sphereMatrix.m00 = rx;
sphereMatrix.m11 = ry;
sphereMatrix.m22 = rz;
}
sphereMatrix.m03 = center.x;
sphereMatrix.m13 = center.y;
sphereMatrix.m23 = center.z;
sphereMatrix.m33 = 1;
}
示例5: getMatrix
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
public static TRSRTransformation getMatrix(FzOrientation fzo) {
Quaternion fzq = Quaternion.fromOrientation(fzo.getSwapped());
javax.vecmath.Matrix4f trans = newMat();
javax.vecmath.Matrix4f rot = newMat();
javax.vecmath.Matrix4f r90 = newMat();
r90.setRotation(new AxisAngle4f(0, 1, 0, (float) Math.PI / 2));
trans.setTranslation(new javax.vecmath.Vector3f(0.5F, 0.5F, 0.5F));
javax.vecmath.Matrix4f iTrans = new javax.vecmath.Matrix4f(trans);
iTrans.invert();
rot.setRotation(fzq.toJavax());
rot.mul(r90);
trans.mul(rot);
trans.mul(iTrans);
return new TRSRTransformation(trans);
}
示例6: testTransform
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
/**
* {@link jp.ac.fit.asura.nao.misc.MatrixUtils#transform(javax.vecmath.Vector3f, javax.vecmath.AxisAngle4f, float, javax.vecmath.Vector3f)}
* のためのテスト・メソッド。
*/
public void testTransform() throws Exception {
Vector3f v = new Vector3f();
RobotFrame fr = new RobotFrame(null);
fr.getTranslation().set(new Vector3f());
fr.getAxis().set(new AxisAngle4f());
FrameState fs = new FrameState(fr);
fs.setAngle(0);
MatrixUtils.transform(v, fs);
assertTrue(new Vector3f().epsilonEquals(v, 0.0001f));
FrameState fs2 = new FrameState(RobotTest.createRobot().get(
Frames.HeadYaw));
fs2.setAngle(1.0f);
v = new Vector3f();
MatrixUtils.transform(v, fs2);
assertTrue(new Vector3f(0, 160, -20).epsilonEquals(v, 0.0001f));
}
示例7: testRot2omega
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
public void testRot2omega() throws Exception {
Vector3f pyr = new Vector3f(MathUtils.toRadians(0), MathUtils
.toRadians(20), MathUtils.toRadians(20));
Matrix3f rot = new Matrix3f();
MatrixUtils.pyr2rot(pyr, rot);
System.out.println(rot);
Vector3f omega = new Vector3f();
MatrixUtils.rot2omega(rot, omega);
Matrix3f a = new Matrix3f();
a.set(new AxisAngle4f(omega, omega.length()));
System.out.println(pyr);
System.out.println(omega);
System.out.println(a);
MatrixUtils.rot2pyr(rot, pyr);
System.out.println(pyr);
}
示例8: init
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
private void init() {
j3dChildCount = 0;
j3dChildMap = new HashMap();
j3dLinkMap = new HashMap();
sensorList = new ArrayList();
allParentPaths = new ObjectArray();
hasChanged = new boolean[LAST_TRANSFORM_INDEX + 1];
implGroup = new TransformGroup();
matrix = new Matrix4f();
tempVec = new Vector3f();
tempAxis = new AxisAngle4f();
tempMtx1 = new Matrix4f();
tempMtx2 = new Matrix4f();
transform = new Transform3D();
}
示例9: init
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
/**
* Private, internal, common initialisation.
*/
private void init() {
allParentPaths = new ObjectArray();
transform = new TransformGroup();
BranchGroup bg = new BranchGroup();
bg.addChild(transform);
j3dImplNode = bg;
axis = new AxisAngle4f();
trans = new Vector3f();
implTrans = new Transform3D();
implTrans.setIdentity();
}
示例10: J3DTransform
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
/**
* Construct a default instance of this node. The defaults are set by the
* VRML specification.
*/
public J3DTransform() {
super("Transform");
hasChanged = new boolean[LAST_TRANSFORM_INDEX + 1];
implTG = new TransformGroup();
implGroup = implTG;
vfCenter = new float[] {0, 0, 0};
vfRotation = new float[] {0, 0, 1, 0};
vfScale = new float[] {1, 1, 1};
vfScaleOrientation = new float[] {0, 0, 1, 0};
vfTranslation = new float[] {0, 0, 0};
matrix = new Matrix4f();
tempVec = new Vector3f();
tempAxis = new AxisAngle4f();
tempMtx1 = new Matrix4f();
tempMtx2 = new Matrix4f();
transform = new Transform3D();
}
示例11: init
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
/**
* Common initialisation functionality.
*/
private void init() {
j3dImplNode = new Transform3D();
listenerList = new ArrayList(1);
v1 = new Vector3d();
v2 = new Vector3d();
v3 = new Vector3d();
T = new Transform3D();
C = new Transform3D();
R = new Transform3D();
S = new Transform3D();
al = new AxisAngle4f();
changedTransform = new Transform3D[1];
changedTransform[0] = j3dImplNode;
}
示例12: init
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
/**
* Common internal initialisation.
*/
private void init() {
listenerList = new ArrayList(1);
oglMatrix = new Matrix4f();
changedTransforms = new Matrix4f[1];
changedTransforms[0] = oglMatrix;
v1 = new Vector3f();
v2 = new Vector3f();
v3 = new Vector3f();
T = new Matrix4f();
C = new Matrix4f();
R = new Matrix4f();
S = new Matrix4f();
al = new AxisAngle4f();
}
示例13: VisibilityManager
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
/**
* Construct a new manager for visiblity sensors.
*/
VisibilityManager() {
picker = new PickRequest();
picker.pickType = PickRequest.FIND_VISIBLES;
picker.pickGeometryType = PickRequest.PICK_FRUSTUM;
picker.pickSortType = PickRequest.SORT_ALL;
picker.generateVWorldMatrix = true;
picker.origin = new float[24];
viewFrustum = new double[6];
endPoint = new Point3f();
viewAngle = new AxisAngle4f();
localTx = new Matrix4f();
prjMatrix = new Matrix4f();
activeVisSensors = new HashSet();
newVisSensors = new HashSet();
matrixUtils = new MatrixUtils();
invWorldScale = 1;
list = new OGLVisibilityListener[LIST_START_SIZE];
lastListener = 0;
}
示例14: BaseGeoTransform
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
/**
* Construct a default instance of this node. The defaults are set by the
* VRML specification.
*/
public BaseGeoTransform() {
super("GeoTransform");
hasChanged = new boolean[NUM_FIELDS];
vfGeoCenter = new double[3];
vfRotation = new float[] {0, 0, 1, 0};
vfScale = new float[] {1, 1, 1};
vfScaleOrientation = new float[] {0, 0, 1, 0};
vfTranslation = new float[] {0, 0, 0};
vfGeoSystem = new String[] {"GD","WE"};
localCenter = new double[3];
locMtx = new Matrix4f();
tmatrix = new Matrix4f();
tempVec = new Vector3f();
tempVec3d = new Vector3d();
tempAxis = new AxisAngle4f();
tempMtx1 = new Matrix4f();
tempMtx2 = new Matrix4f();
origQuat = new Quat4d();
rotQuat = new Quat4d();
}
示例15: BaseTransform
import javax.vecmath.AxisAngle4f; //导入依赖的package包/类
/**
* Construct a default instance of this node. The defaults are set by the
* VRML specification.
*/
public BaseTransform() {
super("Transform");
hasChanged = new boolean[LAST_TRANSFORM_INDEX + 1];
vfCenter = new float[] {0, 0, 0};
vfRotation = new float[] {0, 0, 1, 0};
vfScale = new float[] {1, 1, 1};
vfScaleOrientation = new float[] {0, 0, 1, 0};
vfTranslation = new float[] {0, 0, 0};
tmatrix = new Matrix4f();
tempVec = new Vector3f();
//tempAxis = new Vector4f();
tempAxis = new AxisAngle4f();
tempMtx1 = new Matrix4f();
tempMtx2 = new Matrix4f();
}