问题
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 error that it show on the console log.
Here simple example of Aframe. https://gist.github.com/Lightnet/8fb3d4a7c5f3ed2b3865bf894aecb9b8
Any way to solve this?
回答1:
You shouldn't perform your operations on the camera = document.querySelector('[camera]');
, because it grabs the a-frame's wrapper around the three 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
.
Check it out on this fiddle.
来源:https://stackoverflow.com/questions/48371678/aframe-vector-unproject-not-working-and-not-surebug