Tag: #graphics
Homogeneous coordinates in 3D
I implement homogeneous coordinates in 3D, including rotation, scaling, translation, and projection matrices, and use them to create an animated 3D house scene. 2020-11-29
Homogeneous coordinates in 2D, from scratch
Homogeneous coordinates enable a matrix to translate points. I show a six-line JS library. 2020-11-28
A matrix library in 5 lines of code
A 5-line matrix library, and how to derive it without rote memorization. 2020-11-27
Simulating epidemics with WebGL
A spatial SIR model for simulating epidemics, implemented using WebGL fragment shaders. Tracks susceptible, infected, and recovered populations in a 2D grid. 2020-02-23
WebGL shading: both diffuse and specular
A WebGL shader that combines diffuse and specular lighting, allowing the user to adjust the relative contribution of each using keyboard controls. Guest post by Luís Fonseca. 2017-10-28
Giant Game of Life
Implements a 1024x1024 grid of Conway’s Game of Life using WebGL fragment shaders. 2017-10-23
Game of Life implemented with a fragment shader
A Conway’s Game of Life simulation implemented using WebGL fragment shaders, with rendering to texture and a Gosper Glider Gun initial state. 2017-10-22
Drawing a cube in WebGL
Rendering an animated 3D cube in WebGL using a vertex shader, face color uniforms, and matrix transformations for rotating the cube. 2017-10-21
Generated normal-mapped ripples
Generating dynamic normal-mapped ripple effects using WebGL, with the mouse position controlling the light source. 2017-10-20
GLSL varying variables
GLSL
varying
allows vertex shader outputs to be passed to fragment shaders. A WebGL demo with colors interpolated between vertices. 2017-10-19All content copyright James Fisher.