glLoadIdentity

Can anyone tell me please why do we use glLoadIdentity. I am fully aware that we get identity matrix by calling the function but why do we need to call it all the time? I’d really appreciate if someone could explain this in simple English.

Suf.

Calling glLoadIdentity is like washing a painters brush.

While rendering/painting a scene, your matrix/brush will be stained with the current transformation/color you last used.

Before rendering/painting another scene, it is wise to clear your matrix/wash your brush.

Of course you don’t have to call glLoadIdentity/wash your brush, but then I think you can guess what might happen.

NOTE: You can also use glPushMatrix(), before rendering and glPopMatrix() after to avoid calling glLoadIdentity(), its like having extra brushes for each color.