[whatwg] Web Applications and 3D

Matthew Raymond mattraymond at earthlink.net
Fri Apr 29 06:14:37 PDT 2005

Ian Hickson wrote:
> On Thu, 28 Apr 2005, Matthew Raymond wrote:
>>The problem with a <canvas> solution is that the entirety of the 3D data
>>has to exist within the <canvas> element. If you want multiple elements in the
>>markup to map to a single 3D window, then <canvas> doesn't really work.
> Right, but my question is what's the use case for having objects for your 
> 3D world exist in the DOM?

    Well, in situations with Javascript off, the benefits are obvious. 
There's also the potential to use XBL to apply special behavior to 
specific tags. For instance, instead of having a static Sun in the sky, 
you could have it rise and set by using XBL to pull in code that moves 
the model and lighting around.

>>>Having said that, there are probably use cases for declarative 3D, 
>>>just like there are with declarative 2D. And for those you would use a 
>>>dedicated markup language, just like you use SVG for 2D graphics.
>>My point was that I'd like to see a CDF (not the CAD kind, but the W3C 
>>kind) that uses XHTML + X3D, or XHTML + CSS + XBL2 + X3D. While I think 
>>it has a lot of potential, I don't know enough about how the respective 
>>standards to determine would work together. (This is partly because of 
>>my lack of knowledge of XBL2 and X3D...)
> If it wouldn't work together, it indicates a problem in the X3D spec (or 
> the lack of an appropriate 3D declarative markup language).
> Creating a 3D markup language is somewhat outside the purview of this 
> working group, though.

    I'm not saying there's a problem with X3D. I'm just trying to make 
sure there is a clear idea of how to make XHTML + X3D compound 
documents. In other words, I'm trying to find the weak link, if there is 
one, and at the moment that seems to be a lack of examples on the Internet.

>>I already knew the HTML. I was kinda hoping to see the CSS/XBL2 part of 
>>that equation. That's the part I'm confused about. Does XBL2 have a CSS 
>>binding property like XBL 1.0?
> XBL2 doesn't exist yet, but the idea is it will have that, yes.

    Good. I don't see nearly as strong a use case for XBL without such 

> I don't see people writing 3D games using a declarative format. Maybe for 
> the models, as external files that are slurped in (just like external 
> bitmaps are used as sprites with 2D canvas), but that's very different 
> from having the 3D in the document.

    My thinking is that a "3d" context for <canvas> may require 
Javascript as complex as a 3D rendering engine built on top of OpenGL. 
By contrast, something like X3D would require only DOM manipulation, 
because the rendering engine would be either a plug-in or part of the 
UA. X3D could also use XBL to achieve special effects that a programmer 
would otherwise have to code into their <canvas>-based engine. Imagine 
LOD, particle effects, fog, et cetera, turned on and off by simply 
selecting an alternate stylesheet. (Well, I suppose you could do that 
stylesheet thing with <canvas> and XBL, but it wouldn't be pretty.)

>>I mean stuff like having windows that get smaller when they're further 
>>back in the Z-order. Perhaps there's a fog effect. You could have 
>>various <section> elements rendered within a 3D environment, where the 
>>user looks in a specific direction or in a specific place to see the 
>><section> inside a 3D environment. Stuff like that.
> That'd just be up to the UA, really.

    No, I meant as in the web author implementing that with web 
standards, not the UA adding those effects to vanilla HTML5.

More information about the whatwg mailing list