如何更改 TrackballControls 上的旋转轴心点但保持 camera.lookAt 位置不变? [英] How to change pivot point for rotation on TrackballControls but keep camera.lookAt position same?

查看:45
本文介绍了如何更改 TrackballControls 上的旋转轴心点但保持 camera.lookAt 位置不变?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够改变旋转轴而不改变三点上的相机外观.TrackballControls 无论我尝试过什么,我都无法成功.请给我一个方向来解决这个问题.我真正想要实现的是像鼠标控件一样的 Revit.

I need to be able to change rotation pivot without changing camera lookAt on THREE.TrackballControls no mater what I tried I could not succeed. Please give me a direction to solve this problem. What I am actually trying to achieve is Revit like mouse controls.

推荐答案

我能够通过创建 2 个名为轨道和目标的 3D 对象,然后将目标和相机作为子对象添加到轨道中来解决这个问题......相机总是看起来在 target.position,x 轴上的 mousemove 围绕 Z 轴旋转轨道对象(因此目标和相机围绕轨道旋转),y 轴上的 mousemove 围绕 cameraSideways 方向旋转相机臂(camera.position 矢量).

I was able to solve this problem by creating 2 3D objects named orbit and target, then add target and camera into orbit as child objects... camera always looks at target.position, mousemove on x axis rotates the orbit object around Z axis (hence target and camera rotates around the orbit) and mousemove on y axis rotates the camera arm (camera.position vector) around cameraSideways direction.

这篇关于如何更改 TrackballControls 上的旋转轴心点但保持 camera.lookAt 位置不变?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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