本文整理汇总了Java中javax.vecmath.Vector3f.setZ方法的典型用法代码示例。如果您正苦于以下问题:Java Vector3f.setZ方法的具体用法?Java Vector3f.setZ怎么用?Java Vector3f.setZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.vecmath.Vector3f
的用法示例。
在下文中一共展示了Vector3f.setZ方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyInitTransform
import javax.vecmath.Vector3f; //导入方法依赖的package包/类
public void applyInitTransform(List<Vector3f> helperPoints) {
float shiftX = shift.getX() + initialShift.getX();
float shiftY = shift.getY() + initialShift.getY();
float shiftZ = shift.getZ() + initialShift.getZ();
Quat4f rotationQuat = new Quat4f(0,0,0,1) ;
rotationQuat.mul(rotQuat,initRotQuat);
for (int i = 0; i < helperPoints.size(); i++) {
Vector3f vert = new Vector3f();
vert.setX(helperPoints.get(i).getX());
vert.setY(helperPoints.get(i).getY());
vert.setZ(helperPoints.get(i).getZ());
vert = rotate(vert,rotationQuat);
helperPoints.get(i).setX(vert.getX() * scale.getX() + shiftX);
helperPoints.get(i).setY(vert.getY() * scale.getY() + shiftY);
helperPoints.get(i).setZ(vert.getZ() * scale.getZ() + shiftZ);
}
}
示例2: getXaxis
import javax.vecmath.Vector3f; //导入方法依赖的package包/类
public Vector3f getXaxis() {
Vector3f xAxis = new Vector3f((float) ((yCameraPosition - yCenter) * zUpPosition - (zCameraPosition - zCenter) * yUpPosition),
(float) ((zCameraPosition - zCenter) * xUpPosition - (xCameraPosition - xCenter) * zUpPosition),
(float) ((xCameraPosition - xCenter) * yUpPosition - xUpPosition * (yCameraPosition - yCenter)));
/* Vector3f xAxis = new Vector3f((float) (yCameraPosition * zUpPosition - zCameraPosition * yUpPosition),
(float) (zCameraPosition * xUpPosition - xCameraPosition * zUpPosition),
(float) (xCameraPosition * yUpPosition - xUpPosition * yCameraPosition));
*/
float length = (float) Math.sqrt(xAxis.getX() * xAxis.getX() + xAxis.getY() * xAxis.getY() + xAxis.getZ() * xAxis.getZ());
xAxis.setX(xAxis.getX() / length);
xAxis.setY(xAxis.getY() / length);
xAxis.setZ(xAxis.getZ() / length);
return xAxis;
}
示例3: getYaxis
import javax.vecmath.Vector3f; //导入方法依赖的package包/类
public Vector3f getYaxis() {
Vector3f yAxis = new Vector3f((float) xUpPosition, (float) yUpPosition, (float) zUpPosition);
float length = (float) Math.sqrt(yAxis.getX() * yAxis.getX() + yAxis.getY() * yAxis.getY() + yAxis.getZ() * yAxis.getZ());
yAxis.setX(yAxis.getX() / length);
yAxis.setY(yAxis.getY() / length);
yAxis.setZ(yAxis.getZ() / length);
return yAxis;
}
示例4: getXaxis
import javax.vecmath.Vector3f; //导入方法依赖的package包/类
private Vector3f getXaxis() {
Vector3f xAxis = new Vector3f((float) ((yCameraPosition - yCenter) * zUpPosition - (zCameraPosition - zCenter) * yUpPosition),
(float) ((zCameraPosition - zCenter) * xUpPosition - (xCameraPosition - xCenter) * zUpPosition),
(float) ((xCameraPosition - xCenter) * yUpPosition - xUpPosition * (yCameraPosition - yCenter)));
/* Vector3f xAxis = new Vector3f((float) (yCameraPosition * zUpPosition - zCameraPosition * yUpPosition),
(float) (zCameraPosition * xUpPosition - xCameraPosition * zUpPosition),
(float) (xCameraPosition * yUpPosition - xUpPosition * yCameraPosition));
*/
float length = (float) Math.sqrt(xAxis.getX() * xAxis.getX() + xAxis.getY() * xAxis.getY() + xAxis.getZ() * xAxis.getZ());
xAxis.setX(xAxis.getX() / length);
xAxis.setY(xAxis.getY() / length);
xAxis.setZ(xAxis.getZ() / length);
return xAxis;
}
示例5: getYaxis
import javax.vecmath.Vector3f; //导入方法依赖的package包/类
private Vector3f getYaxis() {
Vector3f yAxis = new Vector3f((float) xUpPosition, (float) yUpPosition, (float) zUpPosition);
float length = (float) Math.sqrt(yAxis.getX() * yAxis.getX() + yAxis.getY() * yAxis.getY() + yAxis.getZ() * yAxis.getZ());
yAxis.setX(yAxis.getX() / length);
yAxis.setY(yAxis.getY() / length);
yAxis.setZ(yAxis.getZ() / length);
return yAxis;
}
示例6: parsePosition
import javax.vecmath.Vector3f; //导入方法依赖的package包/类
private Vector3f parsePosition(String x, String y, String z) {
Vector3f position = new Vector3f();
position.setX(Float.parseFloat(x.substring(x.indexOf('>') + 1, x.lastIndexOf('<'))));
position.setY(Float.parseFloat(y.substring(y.indexOf('>') + 1, y.lastIndexOf('<'))));
position.setZ(Float.parseFloat(z.substring(z.indexOf('>') + 1, z.lastIndexOf('<'))));
return position;
}