Re:Show HN: I made a 3D SVG Renderer that projects textures ...
by badmintonbaseba on Thursday June 05, 2025 @07:06AM
(#44190431)
An other approach would be to apply the transformation to SVG elements separately. Inkscape has a perspective transformation tool, which you can apply to paths (and paths only). It probably needs to do approximation and subdivision on the path itself though, which is possibly more complex.
Re:Show HN: I made a 3D SVG Renderer that projects textures ...
by seveibar on Thursday June 05, 2025 @02:44PM
(#44194543)
Your renderer looks awesome! I was surprised there wasn't an "off the shelf" SVG renderer in native TS/JS, it's a big deal to be able to create 3D models without a heavy engine for visual snapshot testing!
Re:Show HN: I made a 3D SVG Renderer that projects textures ...
by CrimsonCape on Thursday June 05, 2025 @03:02PM
(#44194734)
When you loaded Suzanne, my eye could detect framerate drop when moving the model. What is the hot path in the calculations?
Re:Show HN: I made a 3D SVG Renderer that projects textures ...
by laszlokorte on Thursday June 05, 2025 @07:23PM
(#44196563)
The implementation shown in the video is actually particularly slow because all the geometric transformations are implemented in terms of lenses/optics ([1]) and ramdajs ([2]). So the whole mess is a gigantic stack of nested, composed and curried functions, instead of raw linear algebra (just becaus I could).
I later optimized the hotpath and it is significantly faster (still miles behind webgl/webgpu obviously). You can try yourself if you scroll alll the way to the veeeerrrry bottom here [3].
[1]: https://github.com/calmm-js/partial.lenses [2]: https://ramdajs.com/ [3]: https://static.laszlokorte.de/svatom/
[1]: https://youtu.be/kCNHQkG1Q24?si=3VxfVFtG2MiEEmlX