View Full Version : Including HTML / DOM Elements?

12-10-2009, 06:47 PM
I'm glad to hear WebGL is moving forward in the standards process!

I do have a (stupid) newbie question, though... I totally understand the typical use cases for rendering 3D images/artwork within the browser. What I'm curious about, though, is whether WebGL will allow me to, for example, create a rectangular polygon, and include a snippet of InnerHTML to display within it.

A picture's worth a thousand words -- even this crappy, quickly-thrown-together mock-up of Yahoo!'s homepage:


Will WebGL help me style an HTML page like that, or do I have to hold my breath and wait for css3-3d-transforms (http://dev.w3.org/csswg/css3-3d-transforms/)?


:- Dabe

12-11-2009, 02:43 AM
Currently you can use images, other canvas elements (e.g 2D-Canvas or another WebGL-Canvas) and even videos (using the video-Tag) as texture. If you find a way to render your webpage into an JavaScript-Image-Object this could work. Maybe the browser has some kind of screenshot function?

Another approach:
The 2D-Canvas is able to render text and images. You could theoretically write your own browser implementation with displays a webpage inside a 2D-Canvas. Then you can use that canvas as texture. However, this would probably work, but far to slow to be useful.