【发布时间】:2017-08-11 22:29:12
【问题描述】:
我有一个加载模型的应用程序。
我的服务器以下列格式发回有关用于向右和向上方向的轴的响应信息:
我正在使用三个使用右手坐标系的 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