@@ -15,11 +15,13 @@ the built-in shapes.
1515* [ platonic.html] ( https://peteroupc.github.io/html3dutil/platonic.html ) - A demo featuring the five
1616platonic solids. Demonstrates how vertex and index arrays are built up to create geometric meshes.
1717
18- Here are the methods for creating built-in shapes. All methods described
19- below return a ` Mesh ` object that describes the triangles they
18+ ### Built-In Shapes
19+
20+ The ` Meshes ` class includes several handy methods for creating built-in shapes.
21+ All methods described below return a ` Mesh ` object that describes the triangles they
2022are composed of. See "Custom Shapes" below for more on meshes.
2123
22- ### 3D Figures
24+ ** 3D Figures: **
2325
2426* [ Meshes.createBox()] {@link glutil.Meshes.createBox} - Creates a cube or box.
2527* [ Meshes.createCylinder()] {@link glutil.Meshes.createCylinder} - Creates a cylinder or cone, not including the base
@@ -28,7 +30,7 @@ are composed of. See "Custom Shapes" below for more on meshes.
2830* [ Meshes.createTorus()] {@link glutil.Meshes.createTorus} - Creates a torus (doughnut shape).
2931* [ Meshes.createSphere()] {@link glutil.Meshes.createSphere} - Creates a sphere.
3032
31- ### 2D Figures
33+ ** 2D Figures: **
3234
3335* [ Meshes.createDisk()] {@link glutil.Meshes.createDisk} - Creates a circular disk or a regular polygon, possibly
3436 with a hole in the middle.
@@ -39,7 +41,7 @@ are composed of. See "Custom Shapes" below for more on meshes.
3941### Custom Shapes
4042
4143Also included is a ` Mesh ` class for defining shapes not given among the built-in ones.
42- Shapes can consist of triangles or lines.
44+ Shapes can consist of triangles, lines of points .
4345
4446There are two ways for specifying shapes: through the Mesh constructor, or through
4547methods that specify the mesh's data vertex by vertex.
@@ -176,10 +178,19 @@ Example:
176178### Normals
177179
178180For lighting and shading to work correctly, you must specify normals for all the
179- vertices in the mesh. After generating a mesh, you can use the recalcNormals()
180- method, described below, to help in this.
181+ vertices in the mesh.
182+
183+ #### What Are Normals?
184+
185+ A surface normal vector is generally perpendicular to a surface's edges, and points
186+ away from the surface. When light hits an object's surface, it will shine depending
187+ on how directly the light points to the surface. It will shine the most if the light
188+ is directly opposite to its normal, and not at all if the light is perpendicular to the
189+ normal or in the same direction as the normal.
190+
191+ #### Normals on Built-in Shapes
181192
182- Note that the built-in methods that generate meshes will automatically
193+ The ` Meshes ` class includes built-in methods that will automatically
183194specify the proper normals.
184195
185196#### recalcNormals()
@@ -245,8 +256,8 @@ Examples for setting position:
245256 // rotate the shape 40 units about X axis, 20 units about Y axis,
246257 // and 50 units about Z axis
247258 shape.setQuaternion(GLMath.quatFromEuler(40,20,50));
248- // rotate the shape 20 units about X axis and Y axis
249- shape.setQuaternion(GLMath.quatFromAxisAngle(20,1 ,1,0));
259+ // rotate the shape 20 units about Y axis
260+ shape.setQuaternion(GLMath.quatFromAxisAngle(20,0 ,1,0));
250261 // scale the shape by 2x in all axes
251262 shape.setScale(2,2,2);
252263 // same, but passing an array
0 commit comments