Previous | Next --- Slide 54 of 57
Back to Lecture Thumbnails
Lyynnn

What's the use of pushing/popping a copy of transform onto stack?

sc2019

It's so you can apply transformations on top of the current object. For example, once we draw the torso, we want to translate and rotate the head with respect to the torso's coordinate space. We then pop the transform so that the next object's transforms will not be in the head's coordinate space. We then push again to draw the upper arm so we can apply the transforms to the upper arm in the torso's coordinate space. Think of push/pop as moving between coordinate spaces.