Back to index
Vertex Transformations
Exercises
Move the triangle to the bottom left corner using the
M
matrix.
Move the triangle again, this time to the top right corner.
Center the triangle and scale it to fill the viewport.
Remove the
M
matrix from the transformation and replace it with the rotation matrix
Rz
.
Rotate the triangle 90 degrees clockwise.
Animate the triangle by letting the angle
a
depend on the
uniform
variable
time
.
Vertices / Uniforms
// x, y, z // x, y, z // x, y, z
time:
0.000
Vertex shader
Render window
Compile log
Compile