【问题标题】:How to convert to left hand coordinate system如何转换为左手坐标系
【发布时间】:2017-08-11 22:29:12
【问题描述】:

我有一个加载模型的应用程序。

我的服务器以下列格式发回有关用于向右和向上方向的轴的响应信息:

server format:

我正在使用三个使用右手坐标系的 js,所以我需要将服务器所说的内容转换为这个系统。

upAxis 和 rightAxis 始终返回,可能的值为:x_positive、x_negative、y_positive、y_negative、z_positive、z_negative。

我需要在三个js中从服务器发送给我的左手坐标切换到右手坐标。

我创建了一个入门代码,但我不确定还需要做什么或需要做什么:

function rotate() {
    var a = state.currentInfo; //stores the values for upAxis and rightAxis

    //EXAMPLE FOR X axis
    if (a.upAxis === "x_positive") {
        //object itself
        scene.rotation.x = -90 * Math.PI/180;
    }
}

【问题讨论】:

    标签: javascript function three.js coordinate-systems


    【解决方案1】:

    尝试使用up 属性确定您想要的方向,例如:

    camera.up.set( 1, 0, 0 );
    

    【讨论】:

    • 这将轴向上指向什么? X?您还可以为所有可能性(x,y,z,-x,-y,-z)提供axisup和axisright的解决方案
    猜你喜欢
    • 1970-01-01
    • 2020-11-11
    • 2019-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多