From code to pixels.

I develop games and graphics tools. This is where I write about the programming, geometry and rendering problems I study along the way.

123
const edge = (a, b, p) =>
  (b.x - a.x) * (p.y - a.y) -
  (b.y - a.y) * (p.x - a.x);
signed area
+72.2 px²
winding
counterclockwise
pixels lit
73

Fig. 1. Each pixel asks on which side of three edges its center falls. Reverse the order and the area changes sign, but the picture does not. The sign follows the math convention, with y pointing up. Read about signed area (in Portuguese)

Projects

All projects →

Books

The collection →

Notebook

All articles →

Lab

All experiments →

Follow the work

Devlog Latest · · TessoraWhy level six rejects that cut