Frage

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

War es hilfreich?

Lösung

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".

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top