I made some WebGL extension blocks since it seemed like an interesting project. I have basic GL functions, enough to make a demo of a spinning textured quad with a shader-based whirl effect. It uses codification to create shader code. Snap! gltest1 (berkeley.edu)
I could make it a cube but I'm too lazy to write out all the mesh data for it. As always.
There are also several matrix helper blocks. The matrix multiplication and invert blocks are written in JavaScript, but every other matrix block isn't.
I'm not sure if this belongs in share your projects. Should i put this in advanced topics > mods & extensions?
Oh. Turn on retina display support in settings. I had to use some hacks so that Snap! wouldn't crash whenever I set the canvas size with a retina display.
Now that I realize that, I should make my message more clearer.
Neat. I'll update the block to that the next time I update this project. I remember I made 2 other different ways of creating an identity matrix because I would always forget. For a 4x4 matrix, one was creating a 5-item list with the first item 1 and the rest as 0, except I did that by using map and checking if index = 1, then converting the boolean result to a number. Another one was in my celestial bodies project, where it creating a 4x4 matrix filled with zeros, and using a for loop to set items [1][1], [2][2], [3][3], and [4][4] to 1.
Running WebGL does indeed mean code is being ran on your graphics processor.