Recent

Author Topic: Intricate LSystem Snowflakes: Not Rendering BugZ are bugging me !  (Read 220 times)

Boleeman

  • Hero Member
  • *****
  • Posts: 781
Hi All.

Found a really nice LSystem Snowflake Fractal Maker written in JavaScript that makes intricate snow flake patterns.
I modified it so that it does not have to depend on an online files and so it can run on a local hard disk.

I have tried to convert the JavaScript code to Lazarus and opted to use BGRABitmapTypes and BGRACanvas2d, as it relies on scaling, rotating and translations  (handled by BGRACanvas2d).

The Lazarus code compiles but does not render any snowflake curves.
For some reason r (=angle) is always zero, making the x value always the same.
The r-value should change when the grammar rule changes but I am not seeing that.

I wonder if anyone can possibly help work out how to fix the bugs so some snowflake rendering can happen ?

Attached is a screenshot of what the curves should look like, as well as the JavaScript.
« Last Edit: January 21, 2025, 08:03:44 am by Boleeman »

 

TinyPortal © 2005-2018