Skip to content

Commit 508c652

Browse files
committed
bug fixes
1 parent 34970a4 commit 508c652

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

glmath.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,8 @@ mat4scaled:function(v3,v3y,v3z){
953953
* @param {number} vy Y coordinate.
954954
* @param {number} vz Z coordinate.
955955
* @param {number} vw W coordinate. To transform a 3D
956-
* point, set W to 1.
956+
* point, set W to 1; to transform a 2D
957+
* point, set Z and W to 1.
957958
* @return {Array<number>} The transformed vector.
958959
*/
959960
mat4transform:function(mat,v,vy,vz,vw){
@@ -1064,8 +1065,9 @@ mat4translate:function(mat,v3,v3y,v3z){
10641065
* such as Direct3D's, reverse the sign of the 9th, 10th, 11th, and 12th
10651066
* elements of the result (zero-based indices 8, 9, 10, and 11).
10661067
* <p><b>Choosing the "near" and "far" parameters:</b>
1067-
* Depth buffers often have 16 bits per pixel; each pixel isn't usually
1068-
* a floating-point number. If the ratio of "far" to "near"
1068+
* Depth buffers often have 16 bits per pixel, thus allowing only a limited
1069+
* range of possible values that, in addition, are not evenly spread within
1070+
* the range of "far" and "near". If the ratio of "far" to "near"
10691071
* is too high, the depth buffer can't distinguish well between two objects
10701072
* that are very close to each other and both quite far in the distance.
10711073
* For best results:<ul>

glutil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ Lights.prototype.setParams=function(index,params){
581581
* @return {Lights} This object.
582582
*/
583583
Lights.prototype.setDirectionalLight=function(index,direction){
584-
return this.setParams({"position":[direction[0],direction[1],direction[2],0]});
584+
return this.setParams(index,{"position":[direction[0],direction[1],direction[2],0]});
585585
}
586586
/**
587587
* Sets a point light.

glutil_min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shapes.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
// Create the 3D scene; find the HTML canvas and pass it
1818
// to Scene3D.
1919
var scene=new Scene3D(document.getElementById("canvas"));
20-
scene.setOrtho(
21-
-25,25,
22-
-25/scene.getAspect(),25/scene.getAspect(),
20+
scene.setOrthoAspect(
21+
-20,20,
22+
-10,10,
2323
-20,20
2424
);
2525
var mesh;

squares.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@
117117
time%=100;
118118
scene.render();
119119
for(var i=0;i<scene.shapes.length;i++){
120-
scene.shapes[i].setOrientation(rot,0,1,0);
120+
scene.shapes[i].setQuaternion(
121+
GLMath.quatFromAxisAngle(rot,0,1,0));
121122
}
122123
rot+=5;
123124
});

0 commit comments

Comments
 (0)