X3DOM – Declarative (X)3D in HTML5
Introduction and Tutorial
Yvonne Jung Fraunhofer IGD Darmstadt, Germany
[email protected] www.igd.fraunhofer.de/vcst
© Fraunhofer IGD 3D Information inside the Web n Websites (have) become Web applications n Increasing interest in 3D for n Product presentation n Visualization of abstract information (e.g. time lines) n Enriching experience of Cultural Heritage data n Enhancing user experience with more Example Coform3D: line-up of sophisticated visualizations scanned historic 3D objects n Today: Adobe Flash-based site with videos n Tomorrow: Immersive 3D inside browsers
© Fraunhofer IGD OpenGL and GLSL in the Web: WebGL n JavaScript Binding for OpenGL ES 2.0 in Web Browser n à Firefox, Chrome, Safari, Opera n Only GLSL shader based, no fixed function pipeline mehr n No variables from GL state n No Matrix stack, etc. n HTML5
© Fraunhofer IGD X3DOM – Declarative (X)3D in HTML5 n Allows utilizing well-known JavaScript and DOM infrastructure for 3D n Brings together both n declarative content design as known from web design n “old-school” imperative approaches known from game engine development
Hello X3DOM World
© Fraunhofer IGD X3DOM – Declarative (X)3D in HTML5
• X3DOM := X3D + DOM • DOM-based integration framework for declarative 3D graphics in HTML5 • Seamless integration of 3D contents in Web Browser
© Fraunhofer IGD X3DOM – Declarative (X)3D in HTML5 Completes todays graphics technologies
2D 3D (Final HTML5 spec) (No W3C spec yet)
Declarative Scene-graph Part of HTML document DOM Integration CSS / Events
Imperative Procedural API Drawing context Flexible
© Fraunhofer IGD Benefits: Why Declarative 3D in HTML? n Native Web Bbrowser integration n Plugin/ App free n No issues with user permissions, installation, and security n OS independent, especially on mobile devices n Cluttered: Symbian, Windows Phone, Android, iOS, … n Web Browsers for most devices available n Browser already provides complete deployment structure n Eases proliferation of technology and accessibility of content n No special APIs (such as in game engines) n No expert knowledge required (OpenGL, mathematics, …) n Integrates with standard Web techniques (e.g. DHTML, Ajax)
© Fraunhofer IGD Benefits: Why Declarative 3D in HTML? n Declarative, open, human-readable (wraps low-level graphics) n Utilizing standard Web APIs for integrating content and user interactions n Open architectures (also for authoring) and ease of access n Integration into HTML document instead of closed systems n Metadata: index and search “content” on WebGL apps? n Allows “mash-ups” (i.e. recombination of existing contents) n Open formats enable automated connection of existing data (e.g., geo-information, Flickr) with 3D content n Unify 2D and 3D media development n Declarative content description n Flexible content (cultural heritage, industry,…) n Interoperability: Write once, run anywhere (web/ desktop/ mobile) n Rapid application development
© Fraunhofer IGD Excursus: Web-based APIs and DOM
• Browser provides complete deployment structure • Document Object Model (DOM) is standardized interface that allows manipulating content, structure and style of (X)HTML/ XML documents • Document is structured as tree with nodes • document.getElementById(„myID“); • Nodes/ tags and attributes can be added, removed and modified (usually with JavaScript) • document.createElement(), appendChild(), removeChild() • setAttribute(), getAttribute() • UI events (e.g. ‘mouseover’) can be attached to DOM structure (example) most elements (e.g. , , © Fraunhofer IGD Short introduction of HTML A blue box will soon appear. © Fraunhofer IGD First HTML needs to know about (X)3D © Fraunhofer IGD 3D only works inside the … A blue box will soon appear. © Fraunhofer IGD All 3D objects are children of the … Hello X3DOM World
Hello X3DOM World
Hello X3DOM World