In A-Frame: How do I get the VR camera

荒凉一梦 提交于 2019-12-24 10:49:13

问题


In this example:
https://glitch.com/~query-aframe-cameras I have registered a component which launches a projectile in the direction the user is looking (with a little boost for elevation)

Spacebar or Screen Tap to launch - be sure to be looking above the horizon!

It fails in mobile vr (stereo camera) mode:
Projectiles continue to fire, but from the default orientation of the mono, not the stereo camera

I'm using:
var cam = document.querySelector('a-scene').camera.el.object3D; var camVec = new THREE.Vector3(); var camDir = cam.getWorldDirection(camVec); to get the camera information and spit the projectiles back

QUERY: HOW DO I GET THE STEREO CAMERA INFORMATION

来源:https://stackoverflow.com/questions/57451862/in-a-frame-how-do-i-get-the-vr-camera

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!