문제

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