More L-systems (also in 3d)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
misol101
Posts: 475
Joined: 02 May 2016 18:20

More L-systems (also in 3d)

#1 Post by misol101 » 25 Jun 2018 17:08

Image
(Stick L-System on top of Board L-System)

Inspired by viewtopic.php?f=3&t=8612, but not wanting to hijack IcarusLives' thread, here is another on the same topic. Scripts are batch/Jscript hybrids (mostly jscript).

The archive is here:http://www.mediafire.com/file/zhqk06vc1 ... s.zip/file

I'm using cmdgfx_gdi as usual to draw. However, for the non-3d version, it should be possible to use a pixel font and VT-100 escape sequences for anybody who wishes to use no external programs. There are about 20 L-Systems each for the two batch scripts.

Keys for server-lsystem-js.bat:

'Right arrow (or any other key actually)': draw next L-system
'Left arrow': draw previous L-system
'c': toggle clear screen between each L-system
'd': toggle drawing on/off (drawing is purposely slowed down by default, turn this off to draw at max speed but without seeing drawing)
'b': toggle bezier lines (single control point through screen center) instead of straight lines. Looks different and sometimes interesting (one example below of a von Koch snowflake)
'i': decrease number of iterations, redraw
'I': increase number of iterations, redraw (cannot go above default)

ImageImage

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: More L-systems (also in 3d)

#2 Post by misol101 » 25 Jun 2018 17:45

Image
3d Bush with one extra iteration

Next up is the 3d version, server-lsystem-js-3d.bat.

This one actually creates 3d obj files before rendering them. Depending on CPU speed/disk speed this might take a little while (it is pretty fast on my machine though).

Keys:

'Right arrow (or any other key actually)': draw next L-system
'Left arrow': draw previous L-system
'Space': toggle light-sourcing
'Enter': toggle flatness on/off (toggles for all L-systems)
'D/d': decrease/increase distance
'i': decrease number of iterations, redraw
'I': increase number of iterations, redraw (NO LIMIT, but it is *not* recommended to go more than 1 or in some cases 2 iterations above default)
'p': pause
x/y/z: start/stop rotation around x/y/z axes

Image
Image
Image
Last edited by misol101 on 04 Jul 2018 05:59, edited 2 times in total.

IcarusLives
Posts: 175
Joined: 17 Jan 2016 23:55

Re: More L-systems (also in 3d)

#3 Post by IcarusLives » 25 Jun 2018 23:56

Beautiful work misol :) these are really great implementation!

misol101
Posts: 475
Joined: 02 May 2016 18:20

Re: More L-systems (also in 3d)

#4 Post by misol101 » 04 Jul 2018 05:50

Thanks IcarusLives and thanks for the inspiration!

I updated the archive above: now press 'b' (for 3d version script) to switch to rendering small balls at the vertex points, and press 'b' again to draw both lines and balls.

Drawing the balls is a bit heavier than drawing lines,and especially together, so it might be slow on some machines.

Image
Image
Image
Image

Post Reply