WebGL Hotshot
上QQ阅读APP看书,第一时间看更新

Preface

Welcome to WebGL Hotshot. Web3D was first introduced about the same time as HTML and web browsers in the early 1990s. VRML 1.0, the Virtual Reality Modeling Language, made its L.A. debut by its co-inventors, Mark Pesce, Tony Parisi, and others, as part of the VR SIG (special interest group) organized by Dave Blackburn at Kit and Sherrie Galloway's Electronic Café (http://www.ecafe.com/), a part of Santa Monica's 18th Street Arts Center (http://18thstreet.org/). Meanwhile, 3D was an emerging entertainment medium as Toy Story was released in 1995 about the same time as Microsoft's DirectX 3D game interface, and a few years after Doom launched, one of the first 3D games. VRML 2.0 adopted the tag style, < >, of HTML a few years later. VRML, however, required either a plugin for your web browser, common at the time with the emergence of real audio and flash, or a pure Java implementation such as Dynamic 3D.

For much of the first decade of this century, the commercial applications of 3D graphics were seen in animated movies, special effects, and video games. Web3D had little visibility and was mostly used in research centers such as the U.S. Naval Postgraduate School in Monterey, California, USC Behavioral Technology Labs, and the Fraunhofer Institute for Computer Graphics in Europe. However, two new technologies were about to bring Web3D into the foreground. XML (eXtensible Markup Language) emerged as the file format and validation system for passing data across the Internet, and shader languages provided the ability to program the GPU (Graphics Processing Unit), which was a significant boost in the performance of 3D graphics.

Behind every technology are innovative, imaginative people. Two organizations, Khronos and the Web3D Consortium, provided the implementation of Web3D to be robust and simple for both developers and artists. Khronos (https://www.khronos.org) is a group of major media-centric technology companies dedicated to creating open standards in computer graphics. Khronos defined WebGL and its adoption among web browser developers to enable interactive Web3D. The Web3D Consortium (http://www.web3d.org) defined X3D, the VRML 2.0-based file format using XML standards.

This book will introduce the two leading technologies for interactive Web3D: X3D and WebGL. Emphasis is placed on real-world applications while intertwining technical concepts. We begin with X3D and the fundamental concepts of creating 3D scenes. If you have never built anything in 3D, you'll be amazed at how quickly you can create colorful 3D environments. Then, we transition to WebGL, writing JavaScript to parse the 3D meshes, control the interactivity, and handle the interfacing to the GPU for rendering 3D meshes with texture maps. Then, GPU shader languages are applied to create various lights, free-flowing cloth, and animated waterfalls.

More advanced techniques are then demonstrated, such as integrating WebGL with content from Facebook, the social media site, and with live stock market data to show how 3D can be a more effective means of navigation and communication. We then deploy content from other 3D applications developed by architects and engineers to bring their content to the Web and as an engaging tool for education. Finally, we look at WebGL as art applied to the design of 3D websites to engage audiences like never before.