Three.js 设备方向控件在加载时指向特定目标 [英] Three.js Device Orientation Controls to point at a specific target on load

查看:63
本文介绍了Three.js 设备方向控件在加载时指向特定目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Three.js 中的设备方向控件为 Google Cardboard 设置 Web 应用程序.当我加载场景时,相机的默认目标是 Y 方向(手机上的 Z),那里可能没有任何对象.我想在加载之前定义一个方向.有没有人对如何在不需要旋转场景中的对象的情况下执行此操作有任何建议?

I'm using the Device Orientation Controls in Three.js to set up a web application for Google Cardboard. When I load the scene, the default target of the camera is the Y direction (Z on the phone) where there might not be any objects. I'd like to define a direction before loading. Does anyone have any suggestions on how to do this without the need to rotate the objects in the scene?

预先感谢您的帮助!

推荐答案

将您的相机添加到 THREE.Object3D().旋转父对象.

Add your camera to a THREE.Object3D(). Rotate the parent object.

这篇关于Three.js 设备方向控件在加载时指向特定目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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