Open GoogleCodeExporter opened 8 years ago
[deleted comment]
leave projection matrix alone and pass your modelview matrix to lookat. lookat
overwrites target matrix ;)
and this is desired behavior since it should be your first call while drawing.
mvMatrix = mat4.lookAt([0, 0, 1], [0, 0, 0], [0, 1, 0]);
above gives you "default" opengl camera setup.
-- UPDATE:
Just in case someone might find it useful in the future, here's detailed
projection/modelview howto:
http://www.opengl.org/resources/faq/technical/projection_abuse.php
http://www.opengl.org/resources/faq/technical/viewing.htm
In short: use only mat4.identity and mat4.perspective on projection matrix and
everything else goes in modelview matrix (and camera setup with lookat should
be the very first thing).
BTW - if camera-stationary object is needed - draw it with identity modelview
matrix or (in case a scene tree / matrix stack is in question) use inverse of
lookat matrix (so when multiplied - gives identity)
Original comment by arturczajka@gmail.com
on 3 May 2011 at 8:28
Original issue reported on code.google.com by
dragon8xa2@gmail.com
on 11 Apr 2011 at 3:07