将对象从摄像机视图拖动到特定距离/半径处 [英] Drag object locked at certain distance/radius from camera view

查看:86
本文介绍了将对象从摄像机视图拖动到特定距离/半径处的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有场景中心的一个摄像机,距离摄像机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.

这篇关于将对象从摄像机视图拖动到特定距离/半径处的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆