Export to GitHub

webgl-mjs - issue #2

M4x4.makeLookAt produces wrong results


Posted on Feb 7, 2010 by Happy Bear

The problem is in the creation of the temp matrix tm2 in the code. This block:

tm2[0] = 1; tm2[1] = 0; tm2[2] = 0; tm2[3] = 0;
tm2[4] = 0; tm2[5] = 1; tm2[6] = 0; tm2[7] = 0;
tm2[8] = 0; tm2[9] = 0; tm2[10] = 1; tm2[3] = 0;
tm2[0] = -eye[0]; tm2[1] = -eye[1]; tm2[2] = -eye[2]; tm2[3] = 0;

should be:

tm2[0] = 1; tm2[1] = 0; tm2[2] = 0; tm2[3] = 0;
tm2[4] = 0; tm2[5] = 1; tm2[6] = 0; tm2[7] = 0;
tm2[8] = 0; tm2[9] = 0; tm2[10] = 1; tm2[11] = 0;
tm2[12] = -eye[0]; tm2[13] = -eye[1]; tm2[14] = -eye[2]; tm2[15] = 0;

Comment #1

Posted on Feb 7, 2010 by Happy Bear

Actually tm2[15] = 1 instead of 0

Comment #2

Posted on Dec 15, 2010 by Swift Hippo

This issue was closed by revision 68a0bb55e4.

Status: Fixed

Labels:
Type-Defect Priority-Medium