光标鼠标射线起源的嵌入框架场景 [英] aframe embeded scene with cursor mouse ray-origin

查看:88
本文介绍了光标鼠标射线起源的嵌入框架场景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嵌入式场景和鼠标光标选项(cursor = rayOrigin:鼠标),
似乎存在一个错误,我在框上放置了mouseenter和mouseleave事件以更改其大小。只要页面包含在浏览器中,它就可以正常工作,但是当页面可滚动时,事件就会变得混乱(如gif所示,波纹管所示)。我不知道我是否在某个地方搞砸了,但似乎它来自Aframe。有一个关于github问题的链接(有关它的更多详细信息)。

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:

GIF :

Github问题:
https://github.com/aframevr/aframe/issues/3410

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

推荐答案

鼠标光标组件使用整个窗口来计算位置,因此您需要必须重写它,以利用< canvas> 进行光线投射。

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.

有一种解决方法,您可以制作全屏场景并将其放入< i-frame> ,其中 window 是iframe的主体。

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.

示例此处

这篇关于光标鼠标射线起源的嵌入框架场景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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