Вопрос

I found that if I don't use glLoadIdentity before gluLookAT, then I will see blank screen. I don't understand: why?

Это было полезно?

Решение

gluLookAt basically calculates a transformation matrix consiting of a translation (to the eye point you specified) and a rotation (to orient it). However, this transformation matrix is multiplied with the current matrix. So if the current matrix is not identiy, your camera will end up somewhere else, the rotation and translation operations will be additionally applied. Note that despite the name, gluLookAt can in princple be used to position and orient any object, not just the "camera".

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top