aframe vector unproject无法正常工作,不确定吗? [英] aframe vector unproject not working and not sure?bug?

查看:47
本文介绍了aframe vector unproject无法正常工作,不确定吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用threejs在没有投影的相机的基础上测试没有网格物体的简单3D平面,只是零平面,并且可以正常工作。但是我尝试在Aframe上不起作用,并且有错误。

I try used threejs to test out simple 3D plane without mesh object just zero plane base on camera with unproject and it work. But I try on Aframe it didn't work and there is bug.

getInverse> m.elements错误,它在控制台日志中显示。

getInverse > m.elements error that it show on the console log.

这里是Aframe的简单示例。 https://gist.github.com/Lightnet/8fb3d4a7c5f3ed2b3865bf894aecb9b8

Here simple example of Aframe. https://gist.github.com/Lightnet/8fb3d4a7c5f3ed2b3865bf894aecb9b8

有什么解决方法吗?

推荐答案

您不应该对 camera = document.querySelector('[camera]'); ,因为它抓住了三幅相机周围的A框架包装。

You shouldn't perform your operations on the camera = document.querySelector('[camera]');, because it grabs the a-frame's wrapper around the three camera.

您可以使用 camera.components.camera.camera 访问这三台摄像机。

如前所述,您也可以通过参考文献 AFRAME.scenes [0] .camera

You can access the three camera with camera.components.camera.camera.
As noted, You can also grab it by the reference AFRAME.scenes[0].camera.

在此小提琴

这篇关于aframe vector unproject无法正常工作,不确定吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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