aframe embeded scene with cursor mouse ray-origin

我与影子孤独终老i 提交于 2019-12-02 05:18:34

问题


There seems to be a bug with the embedded scene and the option of mouse cursor (cursor='rayOrigin: mouse'), i've put an mouseenter and mouseleave event on a box to change it's size. It works fine as long as the page is contained in the browser, but when the page is "scrollable" the events get messed up ( like showed in the gif, link bellow). I don't know if I messed up somewhere but it seems that it comes from Aframe. There's a link bellow for the github issue ( more details on it).

GIF :

Github Issue : https://github.com/aframevr/aframe/issues/3410


回答1:


The mouse-cursor component uses the whole window to calculate the position, so You'd have to rewrite it, to utilize the <canvas> for raycasting.

There is a workaround, you can make a fullscreen scene and put it in an <i-frame>, where the window is the iframe's body.

Example here.



来源:https://stackoverflow.com/questions/49065510/aframe-embeded-scene-with-cursor-mouse-ray-origin

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