# HG changeset patch # User Eugen Sawin # Date 1303384369 -7200 # Node ID 46b2839f6f50da3df3741f6c0c995890f6570671 # Parent 15d61d76daa1a56dabefed976ed31f27406781de Fixed yaw. diff -r 15d61d76daa1 -r 46b2839f6f50 scripts/machine.js --- a/scripts/machine.js Thu Apr 21 03:12:51 2011 +0200 +++ b/scripts/machine.js Thu Apr 21 13:12:49 2011 +0200 @@ -61,7 +61,7 @@ this.pos = vec3.create([0, 0, 7]); this.up = vec3.create([0, 1, 0]); this.right = vec3.create([1, 0, 0]); - this.target = vec3.create([0, 0, 1]); + this.target = vec3.create([0, 0, -1]); this.matrix = mat4.create(); } Camera.prototype.moveLeft = function() @@ -91,7 +91,7 @@ Camera.prototype.zoom = function(delta) { var dir = vec3.create(this.target); - vec3.scale(dir, -delta * this.speed.zoom); + vec3.scale(dir, delta * this.speed.zoom); vec3.add(this.pos, dir); } Camera.prototype.pitch = function(delta) @@ -109,6 +109,7 @@ vec3.normalize(right); this.right = right; vec3.cross(this.right, this.up, target); + vec3.scale(target, -1); this.target = target; vec3.normalize(this.target); } @@ -124,7 +125,7 @@ this.matrix = mat4.create([this.right[0], this.up[0], -this.target[0], 0, this.right[1], this.up[1], -this.target[1], 0, this.right[2], this.up[2], -this.target[2], 0, - -x, -y, -z, 1]); + -x, -y, z, 1]); } Camera.prototype.clear = function()