Skip to content

Commit 98b1ee8

Browse files
committed
edit docs further
1 parent 9abe2ec commit 98b1ee8

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

glmath.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ var GLMath={
3737
* each of two other vectors. If both vectors are unit length
3838
* (via {@link glmath.GLMath.vec3norm}), the sine of
3939
* the angle between them is equal to the length of their
40-
* cross product.<p>
40+
* cross product. <small>(More formally, the length of the cross
41+
* product equals |<b>a</b>| * |<b>b</b>| * sin &theta;
42+
* where |<b>x</b>| is the length of vector <b>x</b>.)</small><p>
4143
* The cross product (<b>c</b>) of vectors <b>a</b> and <b>b</b> is found as
4244
* follows:<pre>
4345
* <b>c</b>.x = <b>a</b>.y * <b>b</b>.z - <b>a</b>.z * <b>b</b>.y
@@ -59,6 +61,9 @@ return [a[1]*b[2]-a[2]*b[1],
5961
* If both vectors are unit length
6062
* (via {@link glmath.GLMath.vec3norm}), the cosine
6163
* of the angle between them is equal to their dot product.
64+
* <small>(More formally, the dot
65+
* product equals |<b>a</b>| * |<b>b</b>| * cos &theta;
66+
* where |<b>x</b>| is the length of vector <b>x</b>.)</small>
6267
* @param {Array<number>} a The first vector.
6368
* @param {Array<number>} b The second vector.
6469
* @return {number} A number representing the dot product.

glutil.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,17 @@ LightSource.prototype.setParams=function(params){
516516
function Lights(){
517517
this.lights=[new LightSource()];
518518
/**
519-
* Ambient color for the scene. In the absence of
520-
* other lighting effects, all objects will be given this color.
519+
* Ambient color for the scene. This is the color of the light
520+
* that shines on every part of every object equally and in
521+
* every direction. In the absence of
522+
* other lighting effects, all objects will be given this color.<p>
523+
* <small>Ambient light is an efficient simulation of the
524+
* real-world effect of light bouncing back and forth between
525+
* many different objects in an area. One example of this
526+
* phenomenon is sunlight reaching an indoor room without
527+
* directly hitting it, such that the sunlight reflects off the walls
528+
* and so illuminates most of the room pretty much uniformly.
529+
* Ambient lights simulate this phenomenon.</small>
521530
* @default
522531
*/
523532
this.sceneAmbient=[0.2,0.2,0.2];

0 commit comments

Comments
 (0)