Page 1 of 1

Starting in the distance and drawing in the foreground

Posted: Tue Jul 19, 2005 4:56 am
by Ebola_One
I have written this CFDG file:

Code: Select all

startshape BEGIN

rule BEGIN {
   DRAW {}
}

rule DRAW {
   PERSON {}
   DRAW { y 1 r 20 x 1 size 0.99 }
}

rule PERSON 1 {
   CIRCLE {}
   SQUARE { y -1 b 0.7}
   SQUARE { y -1.7 b 0.4 size 0.8 0.4 }
   SQUARE { y -0.85 x -0.6 b 0.75 size 0.2 0.6 }
   SQUARE { y -0.85 x 0.6 b 0.75 size 0.2 0.6 }
   CIRCLE { y -1.25 x 0.6 size 0.2 0.2 }
   CIRCLE { y -1.25 x -0.6 size 0.2 0.2 }
}

rule PERSON 0.5 {
   CIRCLE { b 0.45 }
   SQUARE { y -1 b 0.7}
   SQUARE { y -1.7 b 0.4 size 0.8 0.4 }
   SQUARE { y -0.85 x -0.6 b 0.75 size 0.2 0.6 }
   SQUARE { y -0.85 x 0.6 b 0.75 size 0.2 0.6 }
   CIRCLE { y -1.25 x 0.6 size 0.2 0.2 }
   CIRCLE { y -1.25 x -0.6 size 0.2 0.2 }
}
But it's not drawing how I'd really like it to, I'd like the people objects to draw over the previous layer, starting small in the center & spiraling outwards

Can anyone help?

Posted: Tue Jul 19, 2005 5:17 am
by lagroue
It's a topic on itself, but, basically, shapes created after others are drawn after them.

So, instead of making your people vanishing, you can make them draw bigger, and add a stop rule so that the infinite process will eventually stop :

Code: Select all

startshape BEGIN 

rule BEGIN { 
   DRAW {} 
} 

// bigger
rule DRAW { 
   PERSON {} 
   DRAW { y 1 r 20 x 1 size 1.01 }
} 

// sometimes stops
rule DRAW 0.01 { 
}

rule PERSON 1 { 
   CIRCLE {} 
   SQUARE { y -1 b 0.7} 
   SQUARE { y -1.7 b 0.4 size 0.8 0.4 } 
   SQUARE { y -0.85 x -0.6 b 0.75 size 0.2 0.6 } 
   SQUARE { y -0.85 x 0.6 b 0.75 size 0.2 0.6 } 
   CIRCLE { y -1.25 x 0.6 size 0.2 0.2 } 
   CIRCLE { y -1.25 x -0.6 size 0.2 0.2 } 
} 

rule PERSON 0.5 { 
   CIRCLE { b 0.45 } 
   SQUARE { y -1 b 0.7} 
   SQUARE { y -1.7 b 0.4 size 0.8 0.4 } 
   SQUARE { y -0.85 x -0.6 b 0.75 size 0.2 0.6 } 
   SQUARE { y -0.85 x 0.6 b 0.75 size 0.2 0.6 } 
   CIRCLE { y -1.25 x 0.6 size 0.2 0.2 } 
   CIRCLE { y -1.25 x -0.6 size 0.2 0.2 } 
}

Posted: Tue Jul 19, 2005 5:41 am
by Ebola_One
Ahhh I see, so by making the current object bigger than the last, it'll naturally push the smaller object into the background, as the current object is the true 1:1 scale object (not taking into account the actual screen size of the object, as the image is scaled to fit on screen)

Code: Select all

startshape BEGIN

rule BEGIN {
   DRAW {}
}

// bigger
rule DRAW {
   PERSON {}
   DRAW { y 1 r 20 x 1 size 1.01 }
}

// sometimes stops
rule DRAW 0.001 {
}

rule PERSON 1 {
   CIRCLE {}
   SQUARE { y -1.7 b 0.1 size 0.81 0.41 }
   SQUARE { y -1.7 b 0.4 size 0.8 0.4 }
   SQUARE { y -1 size 1.01 b 0.05 }
   SQUARE { y -1 b 0.7}
   SQUARE { y -0.85 x -0.6 size 0.21 0.61 b 0.05 }
   SQUARE { y -0.85 x 0.6 size 0.21 0.61 b 0.05 }
   SQUARE { y -0.85 x -0.6 b 0.75 size 0.2 0.6 }
   SQUARE { y -0.85 x 0.6 b 0.75 size 0.2 0.6 }
   CIRCLE { y -1.25 x 0.6 size 0.2 0.2 }
   CIRCLE { y -1.25 x -0.6 size 0.2 0.2 }
}

rule PERSON 0.5 {
   CIRCLE { b 0.45 }
   SQUARE { y -1.7 b 0.1 size 0.81 0.41 }
   SQUARE { y -1.7 b 0.4 size 0.8 0.4 }
   SQUARE { y -1 size 1.01 b 0.05 }
   SQUARE { y -1 b 0.7}
   SQUARE { y -0.85 x -0.6 size 0.21 0.61 b 0.05 }
   SQUARE { y -0.85 x 0.6 size 0.21 0.61 b 0.05 }
   SQUARE { y -0.85 x -0.6 b 0.75 size 0.2 0.6 }
   SQUARE { y -0.85 x 0.6 b 0.75 size 0.2 0.6 }
   CIRCLE { y -1.25 x 0.6 size 0.2 0.2 }
   CIRCLE { y -1.25 x -0.6 size 0.2 0.2 }
}
That's the effect I was after.

I call it Life Spiral

Cheers for your help! :)

Posted: Tue Jul 19, 2005 5:44 am
by lagroue
:) You're welcome !