this post was submitted on 31 Dec 2025
20 points (100.0% liked)

Rust

7631 readers
133 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
 

Hey everyone,

Basically the title. I'd like to learn how to make my own drawing program and I'm slightly surprised that I can't seem to find anything about it. No tutorials or discussions about requirements or just general tutorials.

Does anyone have any recommendations on where I could start?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] solrize@lemmy.ml 8 points 2 days ago (1 children)

If you're unfamiliar with PostScript or basic linear algebra, I would start by reading a book or tutorial on PostScript. Not to know how to produce PostScript output, but rather to understand how it handles coordinate transformations. So your drawing program can have nested objects with a transformation for each object, and the transformations compose through the nesting levels. Then you can rotate and scale complicated figures by just changing a single transformation, which is a 2x3 matrix. It's really 3x3 but in "homogenous coordinates" so you only have to store 6 of the numbers.

Obviously, also play with other drawing programs to get ideas for what you want yours to do.

There are also tons of books on computer graphics, though maybe not specifically about drawing programs. The ones I've looked at are way old by now though.

Linear algebra, I was fine in school with but it's been a hot minute since I've had to actually do anything with it and I never did it in the context of programming.

I'll look into PostScript, thanks!