OpenGL has matrix stack (you can work with this stack by glPush(Pop)Matrix functions). About this stack you can read in your OpenGL book. About matrices you can read in textbook (Linear Algebra)....