Verständnisproblem mit glFrustum()
-
Ich verstehe die OpenGL Funktion glFrustum nicht ganz. ich habe es jetzt mal soweit hin bekommen das ich an der richtigen stelle vom Objekt bin und es heraus und heranzommen kann auf der Z-Achse.
Aber wenn ich es rotieren lasse oder es nach x oder y verschiebe verzerrt sich das objekt ich will nicht das sich das Objekt verzerrt kann.Ich hoffe mir kann jemand helfen.
So habe ich es bis jetzt:
glFrustum(-1.0,1.0,-1.0,1.0,1.0,20);
//glFrustum(links, rechts, unten, oben,zNear, zFar);mfg
Fabi
-
Ich benutze immer gluPerspective, das ist IMHO intuitiver:
Microsoft Platform SDK Dokumentation schrieb:
gluPerspective
The gluPerspective function sets up a perspective projection matrix.void gluPerspective(
GLdouble fovy,
GLdouble aspect,
GLdouble zNear,
GLdouble zFar
);
Parameters
fovy
The field of view angle, in degrees, in the y-direction.
aspect
The aspect ratio that determines the field of view in the x-direction. The aspect ratio is the ratio of x (width) to y (height).
zNear
The distance from the viewer to the near clipping plane (always positive).
zFar
The distance from the viewer to the far clipping plane (always positive).Als Sichtwinkel wähle ich meistens 60°, das sollte in etwa dem menschlichen Sehempfinden entsprechen...
Grüße,
Martin
-
Daran denken, "glu.h" zu inkludieren und glu32.lib gegenzulinken...

-
http://loop.servehttp.com/~vertexwahn/oldwiki/public_html_an_turing/gluPerspective.pdf
http://loop.servehttp.com/~vertexwahn/oldwiki/public_html_an_turing/PerspektivischeProjektion.pdf