I am (very) new to OpenGL, trying to do a University project.
I want to draw to the screen several objects (which come as md2 files actually). Each object has its own 3 parameters: location on the 3d world, scale and rotation.
My question is:
Suppose I did some object manipulation (lets say, I rotated the object). Now lets say I want to manipulate the object again (another rotation, say 5 mins after) - and, I want that now every time that the object is drawn it is drawn with those 2 rotations applied.
How do I save the matrix of the object between the first rotation and the second rotation?
Using glGetf (to get and save the current matrix as a parameter) is not advised (as much as I can tell from googling…)
If I can’t save the matrix every time I do an operation, I would have to save the history of operations (say, rotation1, rotation2, etc…) and every time start from the identity matrix, and do the whole history of operations - which naturally does not make any sense…
Thank you very much
My design is as follows:
With each iteration, the object’s class is in charge of drawing itself. Meaning, the object should set the right matrix parameters (scale, rotation, etc.) and call the display list.
Thus - a way to save the objects current parameters is required (in the meaning described above…)