Programming posters. - Page 1
Forum section: electronics / general

author: hamster_nz
author_rank: Super Contributor
timestamp: September 21, 2020, 11:03:58 pm
content: I know it's pretty trivial, but I've been making posters of programs for on my wall of my workspace.If anybody has some good ideas for interesting graphics that can be done in < 100 lines, with no libraries outside of the standard C ones I'll give them a go.

author: Dubbie
author_rank: Unknown
timestamp: September 22, 2020, 01:54:20 am
content: Can you post the code for the ones you have?It's going to be tricky to do really interesting stuff without a basic vector library or a line drawing function. Adding those would eat pretty much all your lines.

author: golden_labels
author_rank: Super Contributor
timestamp: September 22, 2020, 06:01:42 am
content: The requirements seem quite odd. Why less than 100 lines? That’s an arbitrary limit, akin to to those in assigments in school. Why avoiding dependencies? In particular if that will considerably worsen the output and make the whole thing unneccesserily time wasting and buggy. o ᷼OYou may create a 3D figure by rotating a flat curve around the vertical axis and skewing the coördinate system so that whatever is closer is placed lower. The shape may be a wire mesh consisting of quadrlaterals, so there is no need to apply real 3D rendering algorithms. If you start rotation from the back and draw lines from the bottom, ordering of the points/segments is naturally fitting what you need. Adding colors makes it more intereting.You may also create random aptterns based on L-systems. Preferably the L-system being used to define the crude geometry of the item and the actual generation just using that as the partial input.

author: hamster_nz
author_rank: Super Contributor
timestamp: September 22, 2020, 08:53:24 am
content: Quote from: Dubbie on September 22, 2020, 01:54:20 amSee the three files attached. The generated PPM file format is well-supported under Linux, but Windows users might need to use GIMP or some other image viewing utility to open them.

author: hamster_nz
author_rank: Super Contributor
timestamp: September 22, 2020, 09:08:50 am
content: Quote from: golden_labels on September 22, 2020, 06:01:42 amPrinting on A2 at 300 DPI with a border gives vertical pixels 4660 for the code, and the font I'm using is 23x45 pixels. That gives 4660 / 45 = 103 lines. (at about 6.6 lines per inch).I also want it so anybody who knows a bit of programming can walk up, have a look and have a look at what is going on, then maybe go and try it in the language of their choosing. The idea is that it is completely self-contained.Wasting time generating a one-off image for poster isn't a big issue. Even if it took overnight I wouldn't be too bothered. If it is a 'special simple case' of a more generic problem, if it might attract interest I'm keen.Maybe raytraced spheres over a chess board is next...

author: hamster_nz
author_rank: Super Contributor
timestamp: September 22, 2020, 10:00:34 am
content: WIP, but I am sure a lot of us know where this one will be heading....

author: RenThraysk
author_rank: Regular Contributor
timestamp: September 22, 2020, 11:00:21 am
content: Always like the Lorenz attractor plots. Been a long time (25? years) since wrote some 68K assembly for them. Might be tough to get it within 100 lines though.

author: hamster_nz
author_rank: Super Contributor
timestamp: September 22, 2020, 11:00:53 am
content: Yep, it got there...

author: golden_labels
author_rank: Super Contributor
timestamp: September 22, 2020, 08:55:29 pm
content: blueskullThanks, my brain removed the code from the image. I haven’t noticed them until you mentioned it and I rechecked the pictures.hamster_nzThen the rotated curves should fit into 100 lines and require no dependencies. The L-Systems idea may be harder to execute. While the basic generation itself should not take even half of that space, growing anything on top of the generated data may easily explode into thousands of lines.

author: brucehoult
author_rank: Super Contributor
timestamp: September 22, 2020, 08:56:09 pm
content: Cool idea.I'm guessing you don't want IOCCC-style 100 lines of code :-)

author: hamster_nz
author_rank: Super Contributor
timestamp: September 22, 2020, 10:08:42 pm
content: Quote from: brucehoult on September 22, 2020, 08:56:09 pmIf the picture is awesome enough... sure!