gluPerspective(); ohne Glut?
-
Hi,
wie würde die Funktion gluPerspective(); ohne Glut aussehen (also im Reinen OpenGL) ?
-
void glFrustum(
GLdouble left,
GLdouble right,
GLdouble bottom,
GLdouble top,
GLdouble znear,
GLdouble zfar
);Parameters
left, right
The coordinates for the left and right vertical clipping planes.
bottom, top
The coordinates for the bottom and top horizontal clipping planes.
znear, zfar
The distances to the near and far depth clipping planes. Both distances must be positive.siehe auch: Msdn oder im redbook
-
gluPerspective hat nix mit GLUT zu tun. Das ist ein part der GLU lib.
Wenn du einen Src dazu sehen willst, dann lade dir die MESA Lib runter. Da hast du alle Funcs im Klartext.
-
h = cos(fov/2) / sin(fov/2); w = h / aspect; /* 4x4 Matrix 2*zn/w 0 0 0 0 2*zn/h 0 0 0 0 zf/(zf-zn) 1 0 0 zn*zf/(zn-zf) 0 */