从相机视图拖动锁定在特定距离/半径处的对象 [英] Drag object locked at certain distance/radius from camera view

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

问题描述

我在场景的中心有一个相机,距离相机 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天全站免登陆