logoalt Hacker News

laszlokortetoday at 4:40 PM0 repliesview on HN

Very cool! I did a similar (but much simpler!) experiment by implementing perspective projection via SQL, storing meshes (vertices, edges, faces), the camera position and the screen size in tables and building a single query that generates the SVG paths (including backface culling). Running via WASM SQlite inside the web browser. [1]

  SELECT project(...) as x, project(...) as y 
  FROM model, vertex, camera, transform 
  WHERE clockwise AND clipped IN BETWEEN -1 AND 1
[1]: https://static.laszlokorte.de/sql3d/