当前位置: 首页>>代码示例>>Java>>正文


Java Vector3f.setZ方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:Fidentis,项目名称:Analyst,代码行数:22,代码来源:CompositeModel.java

示例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;
}
 
开发者ID:Fidentis,项目名称:Analyst,代码行数:16,代码来源:ComparisonGLEventListener.java

示例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;
}
 
开发者ID:Fidentis,项目名称:Analyst,代码行数:10,代码来源:ComparisonGLEventListener.java

示例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;
}
 
开发者ID:Fidentis,项目名称:Analyst,代码行数:16,代码来源:GeneralGLEventListener.java

示例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;
}
 
开发者ID:Fidentis,项目名称:Analyst,代码行数:10,代码来源:GeneralGLEventListener.java

示例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;
}
 
开发者ID:Fidentis,项目名称:Analyst,代码行数:8,代码来源:CompositePanel.java


注:本文中的javax.vecmath.Vector3f.setZ方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。