我在屏幕上有始终面向用户的文本,并使用以下代码保持直立(这是有效的):
object.lookAt(camera.position);
object.rotation.x = 相机.rotation.x;
object.rotation.y = camera.rotation.y;
object.rotation.z = camera.rotation.z;
现在,在按钮将场景绕 y 轴旋转 90 度后,
target = new THREE.Vector3(camera.position.z, camera.position.y, -camera.position.x);
object.lookAt(目标);
所以文本根据需要面向用户,但是当我使用轨迹球控件旋转场景时,我无法弄清楚如何计算对象旋转以保持文本垂直:
object.rotation.x = ??
object.rotation.y = ??
object.rotation.z = ??
建议?谢谢!