© Rakesh Baruah 2021
R. BaruahAR and VR Using the WebXR APIhttps://doi.org/10.1007/978-1-4842-6318-1_3

3. Toward the Third Dimension in WebGL

Rakesh Baruah1  
(1)
Brookfield, WI, USA
 

We completed the previous chapter with a red rectangle painted into the window of a Web browser. The process to make the rectangle included the following steps: setting up data inside a vertex and fragment shader; storing the information in buffers; and commanding the WebGL application to execute its drawing instructions. If these steps make up the state and behavior of a WebGL program that rasterizes 2D content, and every WebGL program is a machine that operates on state, then how can we use what we have already created to add a third dimension to our scene?

The following ...

Get AR and VR Using the WebXR API: Learn to Create Immersive Content with WebGL, Three.js, and A-Frame now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.