【问题标题】:In Three.js Picking Ray, How Objects moves only X,Z? not Y在 Three.js Picking Ray 中,对象如何仅移动 X、Z?不是Y
【发布时间】:2012-09-10 16:30:04
【问题描述】:

现在物体向各个方向移动。 但我只想让对象移动 X 或 Z,而不是 Y。

我试试这个。但效果不好。

鼠标移动

// OBJECT SELECTED
if ( SELECTED ) 
{       
    var intersects = ray.intersectObject( PICKING_PLANE );SELECTED.position.set( intersects[ 0 ].point.x, 0, intersects[ 0 ].point.y ); /*SELECTED.position.copy( intersects[ 0 ].point.subSelf( offset ) );*/
    return;
}

我该如何解决这个问题?

【问题讨论】:

    标签: webgl three.js mouse-picking ray-picking


    【解决方案1】:

    存储开始拖动对象时的 Y 位置。 然后在拖动时应用该 Y 位置。

    【讨论】:

      猜你喜欢
      • 2013-04-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-14
      • 1970-01-01
      • 1970-01-01
      • 2022-01-18
      • 1970-01-01
      相关资源
      最近更新 更多