If you have purchased a Packt book and/or video, you can use this page to
• Download the code or support files
• View errata and amendments
• Send us feedback

## You selected

### WebGL Beginner's Guide

#### Published 2012-06-15

Would you like to receive occasional emails about free content, recommended titles and site wide deals? you can unsubscribe at any time.

## Errata

- 5 submitted: last submission 21 Apr 2017

Errata type: Code | Page number: 78

The color picker now remember the last color selected. Also the Lambert sphere exercise has been updated with the missing y-axis slider.
The updated working exercises can be found at WebGL Beginner’s Guide – Examples.
The repository with the source code has been updated at Download the source code.

Errata type: Code | Page number:80

The code line

gl.uniform3f(prg.uLightDirection, 0.0, 0.0, -1.0)

in step 7 of page 80, should be

gl.uniform3f(prg.uLightDirection, 0.0, -1.0, -1.0)

Errata type: Code | Page number: 96

The code has been updated in the BitBucket repository, at:

http://bitbucket.org/dcantor/webgl-beginner's-guide-code

The code example has been updated at:

http://voxelent.com/html/beginner's-guide/1727_03/ch_3_Wall_Final.html

Errata Type : Technical | Page number: 61

In the Normals section for calculating the normals the Vector values for v1 and v2 in the explanation have been mentioned incorrectly. The values vector v1 should be p1 - p0 and v2 should be p2 - p0.

Errata typr: Technical   |  Page number: 62

The line is:

For example, say that the vertex p1 is being shared by triangles #1 and #2

The line should be:

For example, say that the vertex p0 is being shared by triangles #1 and #2

Errata Type: Typo | Page: 85

It is:

Unlike the Lambertian reflection model, the Goraud lighting model ...

Should be:
Unlike the Lambertian reflection model, the Phong reflection model ...

Errata Type: Technical | Page: 141

It is:

The predefined variable, gl_Position , stores the NDC coordinates for each vertex of every object defined in the scene.

Should be:

The predefined variable, gl_Position , stores the clip-space coordinates for each vertex of every object defined in the scene.

Page 115 must read [keeping the italics]:
3. The Perspective matrix implements the projection transformation. Multiplying vertices in view coordinates by this matrix produces vertices in clip coordinates. After perspective division, vertices will be in normalized device coordinates (NDC).
The text on page 140 under Have a go hero, must read:
Remember that once we have multiplied vertices by Model-View matrix, the next step is to obtain vertices in clip coordinates: