简体   繁体   中英

Does gluLookAt() have a limit on smallest argument size?

I have an OpenGL program which works when I call this:

gluLookAt(0.1,0.1,0.1, 0,0,0, 0,0.1,0);

... but not when I call this:

gluLookAt(0.01,0.01,0.01, 0,0,0, 0,0.01,0);

(In the latter case, a blank screen occurs.)

Does gluLookAt have a minimum/maximum floating point argument size?

Drawing is done about the origin, within a radius of ~10-6.

Check your value of gluPerspective's minimum draw distance:

gluPerspective(45.0, (double)window.GetWidth() / (double)window.GetHeight(), 0.1d, 2000.0d);

This will not work because everything is in-front of 0.1.

gluLookAt should work fine with your arguments. However, you are changing the camera position (as @sftrabbit says). Your new position might be too close to the object to see it.

You should check what is the near-plane distance in your perspective matrix setup (possibly your gluPerspective() call?).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM