问题
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