将对象从摄像机视图拖动到特定距离/半径处
问题描述:
我有场景中心的一个摄像机,距离摄像机z = 400的1个球体,其中心位于中心。
I have a camera in the center of the scene, 1 sphere at z=400 distance from the camera, with it's parent in the center.
我想将球体向上拖动/从视图中向下/向左/向右,但同时不从中心改变它的z - 位置。
I want to drag the sphere up/down/left/right from the view but at the same time not change it's z - position from the center.
答
我结束了使用另一个球体并使其不可见,将 side:THREE.DoubleSide
添加到材质并用于光线投射。
I ended up using another sphere and make it invisible, add side: THREE.DoubleSide
to the material and use it for raycasting.