WebGL : Basic Transformation

This example shows how you can rotate a rectangle in WebGL. Open the Javascript tab and the see the code with inline explanation.

1
2
<button id="rotate"> Rotate </button>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
#rotate{
display: block;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
/**
* @author diode / https://vipin.link
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Share

Output