gluLookAtãglLoadMatrixã§ç½®ãæãã¦ã¿ã
ã¬ã³ãã©ã«ã«ã¡ã©ä½ç½®ã渡ãã®ã«ä¾¿å©ãªããã«ãã«ã¡ã©ã®ä½ç½®ãè¡åã§ä¿æãããã¨ã«ããã
ãã¨ãã¨ã
gluLookAt(pos[0], pos[1], pos[2], target[0], target[1], target[2], up[0], up[1], up[2])
ã¨ãã¦ããã®ã
大ééããã¦ãããã¨ãå¤æã以ä¸ãç´ãã¾ãã(5/15)
glGetFloat(GL_MODELVIEW_MATRIX)ã§è¦ãªããç´ããã®ã§å¤å大ä¸å¤«ï½
z=normalize(pos-target) x=normalize(numpy.cross(up, z)) y=normalize(numpy.cross(z, x)) distance=norm(target-pos) m=numpy.array(( (x[0], y[0], z[0], 0), (x[1], y[1], z[1], 0), (x[2], y[2], z[2], 0), (0, 0, -distance, 1.0), ), 'f') glLoadMatrixf(m)
ã§ã»ã¼åçã
OpenGLã®è¡åã®ä¸¦ã³ãåã»è¡ãªã®ã«æ³¨æããã