GiC (Gestalten in Code) Lang

Back to examples

Perspective Through Shadow

Perspective Through Shadow thumbnail

Based on Fabian's shadow sketch, a small black triangle touches the lower-right corner of a white square. Their aligned edges make the triangle read as a cast shadow against a neutral gray ground.

// ABOUTME: Draws a white square and a small triangular shadow.
// ABOUTME: Adapts Fabian's shadow composition to GIC coordinates.
// Source: https://snippets.qawsed.site/p5js/perspective/shadow/index.js
background(90, 0, 0);
fill("white");
rect(35, 45, 30, 30);
fill("black");
noStroke();
triangle(65, 60, 70, 60, 65, 75);