aframe:外观控件如何设置其初始值 [英] aframe: how does look-controls set its initial values

查看:27
本文介绍了aframe:外观控件如何设置其初始值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当一个 AFrame 被加载并且一个 camera 组件被设置为启用 look-controls 时,当前的设备(移动)的方向设置相机的旋转和位置的值?

When an AFrame <scene> gets loaded and a camera component has been set with look-controls enabled, how does the current orientation of the device (mobile) set the values of rotation and position of the camera?

因为一个场景会有一个特定的原点.我发现当从不同位置打开场景时,初始视图是不同的,而我希望它是向前看"视图.

Since a scene will have a certain point of origin. I have found that when open the scene from different positions the initial view is different, while I would like it to be the "look ahead" view.

代码很简单:

<a-entity camera="userHeight:1.6" look-controls></a-entity>

推荐答案

look-controls 从手机的传感器获取方向,该方向是绝对的,而不是相对于您最初放置相机的位置现场.初始值被来自传感器的值覆盖.2017 年的手机没有位置跟踪,但有一个头颈部模型,并计算你的眼睛相对于你的脖子底部的位置,这是旋转支点.

look-controls takes the orientation from the sensors of the phone that is absolute and not relative to where you position the camera initially in the scene. The initial values are overridden by those coming from the sensors. Phones in 2017 do not have positional tracking but have a head neck model and calculate the position of your eyes with respect of the base of your neck which is the rotation pivot.

我不知道您的应用程序的上下文,但在 VR 中,您不能像在传统 3D 应用程序中那样依赖对摄像头的相同程度的控制.如果您要求用户看向某个方向,您可以放置​​提示或指示来影响用户的行为.

I don't know the context of your application but in VR you cannot rely on the same degree of control of the camera that you would have on a traditional 3D application. If you require the user to look in a certain direction you can place hints or indications to influence the user's behavior.

这篇关于aframe:外观控件如何设置其初始值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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