Get ready for #valentines #valentines2025 with this #fetching #itch #itch_io #gamedev #lisp #heart #drawing #tutorial
with #programming #McCLIM #commonLisp
https://lispy-gopher-show.itch.io/lispmoo2/devlog/878075/hearter-than-i-thought-lisp-mcclim-drawing
With some apologies to @mdhughes @jackdaniel @prahou
Discussion here welcome <3
@screwtape What I'd do is make a little graphics language, either as macros or data in a list, then generate the heart or an inverted pentagram or whatever. Wait, you have a turtle graphics thing already? This is just that.
PU RT 30 FD 100 PD LT 60 ARC 180 50
etc.
@mdhughes Oh, yeah, I really heard a drunk old man whose date had left early describe a book he hadn't read, but had seen from a distance at his university in the 70s that was about logo, and I made that ;p. I think I managed to include replaying macros at different scales but not replaying macros at different rotations. It's quite fun to try on touchscreen computers.
@mdhughes The reason for using those with- with- with- things is that some witchcraft clim manages to do is because it turns display stuff into closures, and those with- macros handle changing parameters within the closures clim forms. I realise I didn't manage to explain wherefore those closures here.
@screwtape Yes, but you can also just set your transform matrix as you go, so LT 90 is rotating the world 90° right, etc, and then FD 100 you just draw from 0,0 to 0,100 and then transform by 0,-100…
@mdhughes Oh, yeah, so I didn't know about with-rotation or with-translation back when I wrote that, I guess you only need a with-rotation for the turtle's current orientation in hindsight. I think I just had a forward vector I rotated manually in that.