Back to index

Vertex Transformations

Exercises

  1. Move the triangle to the bottom left corner using the M matrix.
  2. Move the triangle again, this time to the top right corner.
  3. Center the triangle and scale it to fill the viewport.
  4. Remove the M matrix from the transformation and replace it with the rotation matrix Rz.
  5. Rotate the triangle 90 degrees clockwise.
  6. Animate the triangle by letting the angle a depend on the uniform variable time.

Vertices / Uniforms

time:

Vertex shader