Closed GoogleCodeExporter closed 8 years ago
Please close this issue as the following code sample verifies that the library
is indeed working correctly (I was doing something wrong before):
var zoomFactor = 0.88;
var scaleFactorX = 1.0 * zoomFactor;
var scaleFactorY = 1.0 * zoomFactor;
mat4.translate(mTranslate, [0.0, -1.0, 0.0]);
mat4.scale(mScale, [scaleFactorX, scaleFactorY, 1.0]);
//Model * Translate * Scale
mat4.identity(mModel);
mat4.identity(this.mPMVMatrix);
console.log("mPMVMatrix = " + mat4.str(this.mPMVMatrix));
/////////////////////////////////////////////
mat4.multiply(mTranslate, mModel, mModel);
mat4.multiply(mScale, mModel, mModel);
mat4.lookAt(eye, target, up, mView);
mat4.set(mModel, this.mPMVMatrix);
console.log("mPMVMatrix = " + mat4.str(this.mPMVMatrix));
mat4.multiply(mView, this.mPMVMatrix, this.mPMVMatrix);
console.log("mPMVMatrix = " + mat4.str(this.mPMVMatrix));
mat4.multiply(mProjection, this.mPMVMatrix, this.mPMVMatrix);
console.log("mPMVMatrix = " + mat4.str(this.mPMVMatrix));
...
that produces the following output:
[13:10:54.581] "mPMVMatrix = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]"
[13:10:54.585] "mPMVMatrix = [0.8799999952316284, 0, 0, 0, 0,
0.8799999952316284, 0, 0, 0, 0, 1, 0, 0, -0.8799999952316284, 0, 1]"
[13:10:54.589] "mPMVMatrix = [0.8799999952316284, 0, 0, 0, 0,
0.8799999952316284, 0, 0, 0, 0, 1, 0, 0, -0.8799999952316284,
-2.7474775314331055, 1]"
[13:10:54.594] "mPMVMatrix = [1.8133351802825928, 0, 0, 0, 0,
2.4177801609039307, 0, 0, 0, 0, -3.444444417953491, -1, 0, -2.4177801609039307,
-0.31424403190612793, 2.7474775314331055]"
Original comment by Pana...@gmail.com
on 12 Apr 2011 at 11:15
This does indeed seem to be functioning correctly. I'm closing this unless a
better example of defective code can be provided.
Original comment by Tojiro@gmail.com
on 24 Apr 2011 at 4:19
Original issue reported on code.google.com by
Pana...@gmail.com
on 6 Apr 2011 at 1:55