Could somebody try to implement given animation into WebGL shader example? It would be great for people learing WebGL like myself.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
I've implemented your animation at http://www.brainjam.ca/stackoverflow/webglspiral.html. It will give you a "WebGL not supported" message if your browser does not support WebGL. It is adapted from a sandbox created by mrdoob. The basic idea is to show a rectangular surface (consisting of two triangles) and to apply the shader to the surface.
The actual shader code is as follows:
The spiral resizes with the browser window, but you could easily opt for a fixed size canvas instead.
Update: Just for fun, here's the exact same implementation in a jsfiddle: http://jsfiddle.net/z9EmN/