【问题标题】:Plane point rotation to a specific plane平面点旋转到特定平面
【发布时间】:2022-01-12 11:55:00
【问题描述】:

我有一个系统,其中一个轴从 [0 -> 2PI] 移动。这种运动会产生一个有角度的平面。 Axis movement.

这架黄色飞机将是我的目标飞机。我知道这个黄色平面的法向量及其常数。让我根据轴(工具)的旋转值计算黄色平面上的 XYZ 位置。我已经找到了一个“解决方案”,首先计算一个更简单的平面vertical plane [1 0 0] as normal vector 的 XYZ 坐标是什么,因为我知道球体原点和半径,然后很容易根据轴角计算任何 XYZ 位置。

但我的问题是,现在我在灰色平面上拥有 XYZ 位置:如何将我的 XYZ 位置与黄色平面上的相应位置联系起来? From gray plane to yellow plane 任何建议将不胜感激。

【问题讨论】:

    标签: math three.js rotation


    【解决方案1】:

    解决这个问题很简单。我把它弄得比必要的复杂。无需将点从一个平面转换到另一个平面,因为这些值可以很容易地从球体原点和平面方向值计算出来。

    // calculate axis rotation to radians
    let radAngle = (angle)*Math.PI/180;
    let beeta = (90*Math.PI/180) - radAngle; //rotation value on the circle
    let gamma = Math.acos(yellow.normal.x); //plane orientation
    
    // temporary vars
    let cb = Math.cos(beeta); 
    let sb = Math.sin(beeta);
    
    let cg = Math.cos(gamma);
    let sg = Math.sin(gamma);
    
    
    let x = sphere.origin.x + sphere.radius*(cg*sb);
    let y = sphere.origin.y + sphere.radius*(sg*sb);
    let z = sphere.origin.z + sphere.radius*cb;
    

    Rotation sample

    【讨论】:

      猜你喜欢
      • 2017-07-27
      • 1970-01-01
      • 2018-06-05
      • 2017-01-14
      • 1970-01-01
      • 1970-01-01
      • 2011-01-06
      • 1970-01-01
      • 2010-09-12
      相关资源
      最近更新 更多