如果我在 x 中旋转圆柱体,则 y 然后在不同的 theta 中旋转 z.最终圆柱体的 y 轴高度是多少

if I rotate the cylinder in x, then y and then z in different theta. What will be the height in y axis for the final cylinder?

本文关键字:旋转 圆柱体 多少 高度 theta 然后 如果      更新时间:2023-09-26

我是三的新手.js在三.js当我创建一个圆柱体时,默认情况下它将平行于 y 轴,将 y 轴中的高度作为值 a。

然后如果我在 x 中旋转圆柱体,然后在不同的θ中旋转 y,然后旋转 z。最终圆柱体的 y 轴高度是多少(如下面的代码)?

我试过了,但找不到答案。非常感谢您的任何答案。 :)

cylinder.rotation.x = theta1;
cylinder.rotation.y = theta2;
cylinder.rotation.z = theta3;

你可以在数学栈交换上问这个问题,或者你可以执行以下代码(插入你的X、Y和Z值)。所以在这个例子中,我们的圆柱体沿正 y 轴的高度为 1.0:

var x = 0.0;
var y = 1.0;
var z = 0.0;
var e = new THREE.Euler(theta1, theta2, theta3);
var p = new THREE.Vector3(x, y, z);
p.applyEuler(e);
console.log(e);