Loading [MathJax]/extensions/MathMenu.js

2015年2月11日水曜日

glMatrix2.x系の互換性

WebGLのサンプルを見ているとよくglMatrix0.9を使っていることがあるけど新しいglMatrix2.2を使うと若干引数の位置とかが違ったのでメモ。

mat4.perspective(60, gl.viewportWidth / gl.viewportHeight, 0.1, 100.0,projectionMatrix);
mat4.identity(modelViewMatrix);
mat4.lookAt([8, 5, -10],[0, 0, 0],[0, 1, 0],modelViewMatrix);
view raw glmatrix09.js hosted with ❤ by GitHub
mat4.perspective(projectionMatrix, Math.PI * (60/180), gl.viewportWidth / gl.viewportHeight, 0.1, 100.0);
mat4.identity(modelViewMatrix);
mat4.lookAt(modelViewMatrix,[8, 5, -10],[0, 0, 0],[0, 1, 0]);
view raw glmatrix2x.js hosted with ❤ by GitHub