I want to render using the same isometric rendering which Blender3d uses, how can i do this ? Is it possible with just a call to glMultMatrix() ? I tried googling but couldnt find any working matrixes that would result in that kind of rendering mode. i tried this http://en.wikipedia.org/wiki/Isometric_projection,但它真的很奇怪。

这是我现在使用的具有正常透视图渲染的矩阵:

    GLdouble f = cotan(fovy/2.0);
    GLdouble aspect = (GLdouble)width/(GLdouble)height;

    IsoMatrix.x[0] = f/aspect;
    IsoMatrix.y[0] = 0;
    IsoMatrix.z[0] = 0;
    IsoMatrix.w[0] = 0;

    IsoMatrix.x[1] = 0;
    IsoMatrix.y[1] = f;
    IsoMatrix.z[1] = 0;
    IsoMatrix.w[1] = 0;

    IsoMatrix.x[2] = 0;
    IsoMatrix.y[2] = 0;
    IsoMatrix.z[2] = (zfar+znear)/(znear-zfar);
    IsoMatrix.w[2] = (2.0*zfar*znear)/(znear-zfar);

    IsoMatrix.x[3] = 0;
    IsoMatrix.y[3] = 0;
    IsoMatrix.z[3] = -1;
    IsoMatrix.w[3] = 0;

    glMultMatrixd((GLdouble *)&IsoMatrix);

我如何更改它,结果将是:http://rvzenteno.files.wordpress.com/2008/10/rvz_018.jpg

最佳答案

使用glOrtho然后旋转轴更容易:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-10.0f, 10.0f, -10.0f, 10.0f, -10.0f, 10.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef(35.264f, 1.0f, 0.0f, 0.0f);
glRotatef(-45.0f, 0.0f, 1.0f, 0.0f);

10-08 20:03