Page 1 of 1

Map generator

Posted: Mon Jul 11, 2005 11:38 am
by LaT3x

Code: Select all

startshape A

rule A
{
  SQUARE { x 5 s 10 1}
  A {x 9.5 r -45}
}

rule A
{
  SQUARE { x 5 s 10 1}
  A {x 9.5 r 45 }
}

Posted: Mon Jul 11, 2005 11:50 am
by MtnViewJohn
Try it with 60, 90, or 120 degree rotations! Very cool.

Posted: Mon Jul 11, 2005 12:03 pm
by LaT3x
I try with this angles (different combanitos... It was really cool :))
Anyway... I don't understand why the recursivity isn't infinite (there aren't scale down into recursivity). Why the proccess stop?

Posted: Mon Jul 11, 2005 12:58 pm
by megaduck0
I'm guessing an overflow in the x/y coord space?

Notice that

Code: Select all

startshape A 

rule A 
{ 
  SQUARE { x 5 s 10 1} 
  A {x 3 r -0.1}
} 
will draw about 1/3 circle before bailing, but

Code: Select all

startshape A 

rule A 
{ 
  SQUARE { x 5 s 10 1} 
  A {x 2 r -0.1}
} 
will draw forever... Only the x offset amount in A changes.

Posted: Mon Jul 11, 2005 2:46 pm
by MtnViewJohn
They are shrinking. The stopping rule is based on shape area in pixels. As the map gets bigger the individual line sehments get smaller. Eventually they shrink below the stopping limit and rule expansion stops.