O'Reilly logo

WebGL Beginner's Guide by Brandon Jones, Diego Cantor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — coloring the cube

  1. Open the file ch6_Cube.html using your HTML5 Internet browser. You will see a page like the one shown in the following screenshot:
    Time for action — coloring the cube

    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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required