Funny coincidence. I've written a small 3D rendering engine for the ESP32 as well last week. It has standard 3d math, clipping, and rasterization of points, lines and triangles. all in ~1500 lines of code. The repo is not polished yet but you can find it here: https://github.com/aap/psiop