よし、ブロックが 0,0,0 に描かれていて、この glulookat がある
function ugluLookAtf(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz){
var forward = new Array(3);
var side = new Array(3);
var up = new Array(3);
var m = new Array(4);
for(var i = 0; i < m.length; i++){
m[i] = new Array(m.length)
}
forward[0] = centerx - eyex;
forward[1] = centery - eyey;
forward[2] = centerz - eyez;
var f = Math.sqrt(forward[0]*forward[0]+forward[1]*forward[1]+forward[2]*forward[2]);
forward[0] = forward[0]/f;
forward[1] = forward[1]/f;
forward[2] = forward[2]/f;
up[0] = upx;
up[1] = upy;
up[2] = upz;
side[0] = forward[1] * up[2] - up[1] * forward[2];
side[1] = forward[2] * up[0] - up[2] * forward[0];
side[2] = forward[0] * up[1] - up[0] * forward[1];
var f = Math.sqrt(side[0]*side[0]+side[1]*side[1]+side[2]*side[2]);
side[0] = side[0]/f;
side[1] = side[1]/f;
side[2] = side[2]/f;
up[0] = forward[1] * side[2] - side[1] * forward[2];
up[1] = forward[2] * side[0] - side[2] * forward[0];
up[2] = forward[0] * side[1] - side[0] * forward[1];
__identf(m[0][0]);
m[0][0] = side[0];
m[1][0] = side[1];
m[2][0] = side[2];
m[0][1] = up[0];
m[1][1] = up[1];
m[2][1] = up[2];
m[0][2] = -forward[0];
m[1][2] = -forward[1];
m[2][2] = -forward[2];
glMultMatrixf(m[0][0]);
glTranslatef(-eyex, -eyey, -eyez);
}
次のように呼び出されます:ugluLookAtf(0,0,-10,0,0,0,0,1,0);
それでも何も見えないので、それは私のglulookat機能だと思います。
私の質問は、glulookat の計算を正しく行っているかどうかです。