Skip to content

Instantly share code, notes, and snippets.

@sta-c0000
sta-c0000 / graphene-3d-svg.c
Created April 25, 2026 20:58
graphene_matrix_init_look_at issue demo - 3D to 2D NDC svg
/*
gcc -O3 -Wall -o graphene-3d-svg graphene-3d-svg.c $(pkg-config --cflags --libs graphene-1.0) -lm
graphene_matrix_init_look_at issue demo: 3D to 2D NDC svg
NOTE: outputs an svg file to stdout!
graphene-3d-svg >/tmp/box3d2d.svg # output to a file, or
graphene-3d-svg | imv - # pipe directly to an image viewer
fprintf(stderr, "%g\n", num); // for console output
*/