Answers
Exercise A. (4, 9)
Exercise B. (-1, 5)
Exercise C. (5, 0, 8)
Exercise D.
To Transform.py
, add the following method:
def update_scale(self, amount: pygame.Vector3):
self.scale.x *= amount.x
self.scale.y *= amount.y
self.scale.z *= amount.z
Then, call update_scale()
in the main loop of ScalingObjects.py
, thus:
keys = pygame.key.get_pressed()
if keys[pygame.K_UP]:
trans.update_scale(pygame.Vector3(2, 2, 2))
if keys[pygame.K_DOWN]:
trans.update_scale(pygame.Vector3(0.5, 0.5, 0.5))