Time for action – coloring the cube
- Open the file
ch6_Cube.html
using your HTML5 Internet browser. You will see a page like the one shown in the following screenshot:In this exercise, we are going to compare constant versus per-vertex coloring. Let's talk about the page's widgets:
- Use Lambert Coefficient: When selected it will include the Lambert coefficient in the calculation of the final color.
- Constant/Per-Vertex: The two options to color objects explained before.
- Simple Cube: Corresponds to a JSON object where the vertices are defined once.
- Complex Cube: Loads a JSON object where the vertices are repeated with the goal of obtaining multiple normals ...
Get WebGL Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.