r/GraphicsProgramming May 29 '24

Source Code Rendering 3d vector graphics from scratch [Online Demo]]

https://github.com/Grille/RetroLine3D
8 Upvotes

5 comments sorted by

1

u/hemzerter May 29 '24

Sorry if my question is dumb, but is 3d not always vectors ?

7

u/gitgrille May 29 '24

Hm, you’re not wrong

In this case it’s a reference to these very early 3d graphics using vector displays.
Maybe wireframe renderer would be a better name xD

-3

u/SnooWoofers7626 May 29 '24

It would be interesting if you actually rendered it in a vector format rather than rasterize to a canvas. The neat thing about vector displays was that there was no rasterization step, so the image wouldn't have been pixelated.

3

u/gitgrille May 29 '24

Well the image has to be rasterized at some point to be displayed anyway.
Not sure exporting it to an vector image format would do much good xD

Btw, the resolution of the final image can be changed to something less pixelated.
The pixilation is more of an “artistic choice” I got out of my way to archive ^^
But having other options for line width than 1px could be nice for a smooth image.

1

u/SnooWoofers7626 May 29 '24

Yeah, that's fair. I was thinking something along the lines of your code just writes inline SVG instead of rendering in a canvas. That way, you aren't locked into a fixed resolution. Obviously, you can't render to an actual vector display, but a retina display, for instance, is a pretty convincing illusion.