When applying transformations to objects we use glPushMatrix/glPopMatrix. But why don't we use glLoadIdentity only instead?
Thus
glPushMatrix()
..apply tranformations
...draw object
glPopMatrix()
glPushMatrix()
..apply tranformations
...draw object
glPopMatrix()
This is how its supposed to be done right?
can become
glLoadIdentity()
..apply tranformations
...draw object
glLoadIdentity()
..apply tranformations
...draw object
Because you wouldn't be able to do this:
glPushMatrix()
..apply tranformations
glPushMatrix()
..apply ADDITIONAL transformations
..draw object with combined transforms
glPopMatrix()
...draw object without the additional transforms.
glPopMatrix()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With