How to embed a HTML page in webvr

帅比萌擦擦* 提交于 2019-12-08 07:05:05

问题


I have gone through the link "http://learningthreejs.com/blog/2013/04/30/closing-the-gap-between-html-and-webgl/",
But I need not to add the texture instead I need that to be interactive like a webpage. So that i can go and play the inner pages also.


回答1:


From the A-Frame FAQ:

There is no direct way for the browser to display HTML or iframes within WebGL. While it is possible to overlay HTML elements or iframes on top of the canvas, they will not display in VR nor can it integrate with the scene.

Though, we can render basic HTML and CSS as a texture without interactivity. We can paint to a canvas and use the canvas as source for a texture. There are components in the ecosystem that enable this:

HTML Shader




回答2:


As far as I know, you can't. VR requires 2 camera views to be rendered to an offscreen buffer. Browsers on the other hand, render their UI only to the front buffer, and only one view. You might be able to find some shim library that simulates/renders a subset of html via webGL, but I haven't really encountered such a thing.

If you are doing a custom standalone app, you might be able to solve it some other way.



来源:https://stackoverflow.com/questions/52456361/how-to-embed-a-html-page-in-webvr

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