Author Topic: Programming posters.  (Read 3349 times)

0 Members and 1 Guest are viewing this topic.

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2862
  • Country: nz
Programming posters.
« on: September 21, 2020, 11:03:58 pm »
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.



Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline Dubbie

  • Supporter
  • ****
  • Posts: 1115
  • Country: nz
Re: Programming posters.
« Reply #1 on: September 22, 2020, 01:54:20 am »
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.
« Last Edit: September 22, 2020, 02:35:58 am by Dubbie »
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 2543
  • Country: pl
Re: Programming posters.
« Reply #2 on: September 22, 2020, 06:01:42 am »
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 ᷼O

You 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.
Why 📎 | We live in times when half of people have IQ below 100.
 

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2862
  • Country: nz
Re: Programming posters.
« Reply #3 on: September 22, 2020, 08:53:24 am »
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.

See 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.
« Last Edit: September 22, 2020, 09:12:05 am by hamster_nz »
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2862
  • Country: nz
Re: Programming posters.
« Reply #4 on: September 22, 2020, 09:08:50 am »
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 ᷼O

You 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.

Printing 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...  ;)
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2862
  • Country: nz
Re: Programming posters.
« Reply #5 on: September 22, 2020, 10:00:34 am »
WIP, but I am sure a lot of us know where this one will be heading....
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline RenThraysk

  • Regular Contributor
  • *
  • Posts: 107
  • Country: gb
Re: Programming posters.
« Reply #6 on: September 22, 2020, 11:00:21 am »
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.
 
The following users thanked this post: hamster_nz

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2862
  • Country: nz
Re: Programming posters.
« Reply #7 on: September 22, 2020, 11:00:53 am »
Yep, it got there...
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 2543
  • Country: pl
Re: Programming posters.
« Reply #8 on: September 22, 2020, 08:55:29 pm »
blueskull
Thanks, my brain removed the code from the image. I haven’t noticed them until you mentioned it and I rechecked the pictures.

hamster_nz
Then 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.

Why 📎 | We live in times when half of people have IQ below 100.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 6464
  • Country: nz
Re: Programming posters.
« Reply #9 on: September 22, 2020, 08:56:09 pm »
Cool idea.

I'm guessing you don't want IOCCC-style 100 lines of code :-)
 

Offline hamster_nzTopic starter

  • Super Contributor
  • ***
  • Posts: 2862
  • Country: nz
Re: Programming posters.
« Reply #10 on: September 22, 2020, 10:08:42 pm »
Cool idea.

I'm guessing you don't want IOCCC-style 100 lines of code :-)

If the picture is awesome enough... sure!
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->