Page 1 of 1

Quad Green Satellite

Posted: Thu Jul 28, 2005 10:45 pm
by lagroue
In reply to Kapowaz's Quad Green Satellite :

Google's inspiring, and so do you ! :wink:

Image

QuadCities' code draws squares, while this one draws rectangles - this is the only difference.

Code: Select all

startshape scene { color }

rule scene {
rectangle { s 0.7072 1}
# second line for fewer rectangles
rectangle { r 90 s 0.7072 1}
}

rule rectangle {
# alpha for texture
rectangle [ r 90 s 0.7072 y 0.5 alpha -0.2 ]
rectangle [ r -90 s 0.7072 y 0.5 alpha 0.05]
}

rule rectangle {
rectangle [ r -90 s 0.7072 y 0.5 alpha -0.2]
rectangle [ r 90 s 0.7072 y 0.5 alpha 0.05]
}

rule rectangle 0.5 {
	# draw a rectangle
	FILL { s 1.4142 1 }
	# and continue with a lighter texture
	rectangle { alpha -0.9 hue 120 sat -0.5 b 0.5}
}

# remaining is genuine kapowaz

rule FILL { HSQUARE { size 1 } } 

// apply variable hue 
rule HSQUARE { SSQUARE { hue 100 } } 
rule HSQUARE { SSQUARE { hue 110 } } 
rule HSQUARE { SSQUARE { hue 120 } } 
rule HSQUARE { SSQUARE { hue 130 } } 
rule HSQUARE { SSQUARE { hue 140 } } 
rule HSQUARE { SSQUARE { hue 150 } } 

// apply variable saturation 
rule SSQUARE { BSQUARE { sat 0 } } 
rule SSQUARE { BSQUARE { sat 0.2 } } 
rule SSQUARE { BSQUARE { sat 0.4 } } 
rule SSQUARE { BSQUARE { sat 0.6 } } 
rule SSQUARE { BSQUARE { sat 0.9 } } 
rule SSQUARE { BSQUARE { sat 1 } } 

// apply variable brightness 
rule BSQUARE { SQUARE { b 0 } } 
rule BSQUARE { SQUARE { b 0.2 } } 
rule BSQUARE { SQUARE { b 0.4 } } 
rule BSQUARE { SQUARE { b 0.6 } } 
rule BSQUARE { SQUARE { b 0.8 } } 
rule BSQUARE { SQUARE { b 1 } }

Posted: Fri Jul 29, 2005 12:53 am
by lagroue
Random is sweet

Image

Code: Select all

startshape scene { color } 

rule scene { 
rectangle { s 0.7072 1} 
# second line for fewer rectangles 
rectangle { r 90 s 0.7072 1} 
} 

rule rectangle { 
# alpha for texture 
rectangle [ r 89 s 0.7072 y 0.49 alpha -0.2 ] 
rectangle [ r -92 s 0.7072 y 0.49 alpha 0.05] 
} 

rule rectangle { 
rectangle [ r -89 s 0.7072 y 0.49 alpha -0.2] 
rectangle [ r 92 s 0.7072 y 0.49 alpha 0.05] 
} 

rule rectangle 0.3 { 
   # draw a rectangle 
   FILL { s 1.4142 1 } 
   # and continue with a lighter texture 
   rectangle { alpha -0.9 hue -30 sat -0.5 b 0.5} 
} 

rule rectangle 0.3 { 
   # draw a rectangle 
   FILL { s 1.4142 1 } 
   # and continue with texture 
   rectangle { alpha -0.2 } 
} 

rule rectangle 0.1 { 
   # draw a rectangle 
   FILL { s 1.4142 1 } 
} 

# remaining is genuine kapowaz 

rule FILL { HSQUARE { size 1 } } 

// apply variable hue 
rule HSQUARE { SSQUARE { hue 100 } } 
rule HSQUARE { SSQUARE { hue 110 } } 
rule HSQUARE { SSQUARE { hue 120 } } 
rule HSQUARE { SSQUARE { hue 130 } } 
rule HSQUARE { SSQUARE { hue 140 } } 
rule HSQUARE { SSQUARE { hue 150 } } 

// apply variable saturation 
rule SSQUARE { BSQUARE { sat 0 } } 
rule SSQUARE { BSQUARE { sat 0.2 } } 
rule SSQUARE { BSQUARE { sat 0.4 } } 
rule SSQUARE { BSQUARE { sat 0.6 } } 
rule SSQUARE { BSQUARE { sat 0.9 } } 
rule SSQUARE { BSQUARE { sat 1 } } 
rule SSQUARE { BSQUARE { sat -0.2 } } 
rule SSQUARE { BSQUARE { sat -0.4 } } 

// apply variable brightness 
rule BSQUARE { SQUARE { b 0 } } 
rule BSQUARE { SQUARE { b 0.2 } } 
rule BSQUARE { SQUARE { b 0.4 } } 
rule BSQUARE { SQUARE { b 0.6 } } 
rule BSQUARE { SQUARE { b 0.8 } } 
rule BSQUARE { SQUARE { b 1 } }

Posted: Fri Jul 29, 2005 1:53 am
by grimace
That's wicked!

Posted: Fri Jul 29, 2005 5:49 am
by lagroue
I'm so glad with these rules I made a desktop background of it.

Image
Image

Posted: Fri Jul 29, 2005 11:12 am
by MtnViewJohn
There should be a way to suppress the white borders for cfdg files that look better without them.

Posted: Fri Jul 29, 2005 12:26 pm
by lagroue
MtnViewJohn wrote:There should be a way to suppress the white borders for cfdg files that look better without them.
You would never know how to crop. :?:
But allowing to remove the white background for alpha-enabled canvas would be a must !

Posted: Fri Jul 29, 2005 4:39 pm
by MtnViewJohn
Cropping would still work. The cropping code deliberately adds space beyond shape closest to each edge. We could suppress the extra space and crop right to the boundary of the shapes. There would be a little be of extra space when circles or triangles are at the edge since the shape boundary code just assumes everything is a square.

I'm adding a background statement to the next experimental release that lets you change the color/alpha of the canvas background. I was originally going to add color parameters to the startshape parameter list but Mark heaped so much scorn on my idea that I took it out.

Posted: Sat Jul 30, 2005 4:42 am
by lagroue
MtnViewJohn wrote:Cropping would still work. The cropping code deliberately adds space beyond shape closest to each edge. We could suppress the extra space and crop right to the boundary of the shapes. There would be a little be of extra space when circles or triangles are at the edge since the shape boundary code just assumes everything is a square.
You're right ! Idea : add a nice slider at the top of the window, which will live resize the drawing (the imperfections of the shape boundary code will thus be fixed easily, just by the eyes), and affect "Save image..." and "Render with dimension..." commands.
MtnViewJohn wrote:I'm adding a background statement to the next experimental release that lets you change the color/alpha of the canvas background. I was originally going to add color parameters to the startshape parameter list but Mark heaped so much scorn on my idea that I took it out.
Ho my god he's being bad ! :lol:
(Sorry, Mark, will you add the slider on the Mac version all the same ?)

(Now that I think of it : when a new window opens, you can't tab to the coding area : you stay in the toolbar. Well, besides that, a new window should actually have focus on the coding area)

Posted: Tue Aug 02, 2005 2:23 am
by momo
i liked this one a lot and tryed to do write my own cfdg file.

Code: Select all

startshape SCENE { color }

rule SCENE {
	ASHAPE { }
	SCENE { x -0.25 y -0.25 s 0.5 alpha -0.2}
	SCENE { x -0.25 y 0.25  s 0.5 alpha -0.2}
	SCENE { x 0.25 y 0.25 s 0.5 alpha -0.2}
	SCENE { x 0.25 y -0.25 s 0.5 alpha -0.2}
}

rule SCENE {
	ASHAPE { }
	SCENE { x -0.25 y -0.25 s 0.5 alpha -0.1}
	SCENE { x -0.25 y 0.25  s 0.5 alpha -0.1}
	SCENE { x 0.25 y 0.25 s 0.5 alpha 0.05}
	SCENE { x 0.25 y -0.25 s 0.5 alpha -0.01}
}

rule ASHAPE { BSHAPE{hue 100}}
rule ASHAPE { BSHAPE{hue 110}}
rule ASHAPE { BSHAPE{hue 120}}
rule ASHAPE { BSHAPE{hue 130}}
rule ASHAPE { BSHAPE{hue 140}}
rule ASHAPE { BSHAPE{hue 150}}

rule BSHAPE 0.05 { CSHAPE{sat 0}}
rule BSHAPE { CSHAPE{sat 0.7}}
rule BSHAPE { CSHAPE{sat 0.8}}
rule BSHAPE { CSHAPE{sat 0.9}}
rule BSHAPE { CSHAPE{sat 1}}
rule BSHAPE 0.05 { CSHAPE{sat -0.4}}
rule BSHAPE 0.05 { CSHAPE{sat -0.5}}


rule CSHAPE { DSHAPE {}}
rule CSHAPE { DSHAPE{alpha -0.7}}
rule CSHAPE { DSHAPE{alpha -0.8}}
rule CSHAPE { DSHAPE{alpha -0.9}}
rule CSHPAE { DSHAPE{alpha 0.5}}

rule DSHAPE { ESHAPE{s 1 0.8} }
rule DSHAPE { ESHAPE{s 0.8 1} }
rule DSHAPE { ESHAPE{s 0.9 0.5} }
rule DSHAPE { ESHAPE{s 0.8 0.7} }
rule DSHAPE { ESHAPE{s 0.8 0.9} }
rule DSHAPE { ESHAPE{s 0.7 1} }

rule ESHAPE 0.05 { FSHAPE{b 0}}
rule ESHAPE 0.09 { FSHAPE{b 0.2}}
rule ESHAPE { FSHAPE{b 0.4}}
rule ESHAPE { FSHAPE{b 0.6}}
rule ESHAPE 0.05 { FSHAPE{b 1}}

rule FSHAPE { GSHAPE { r 3 }}
rule FSHAPE { GSHAPE { r -3 }}
rule FSHAPE { GSHAPE { r 1 }}
rule FSHAPE { GSHAPE { r -1 }}
rule FSHAPE { GSHAPE { r 90 }}
rule FSHAPE { GSHAPE { r -90 }}
rule FSHAPE { GSHAPE { }}

rule GSHAPE { SQUARE { }}
Anyway, there's a problem i don't know how to fix. The file renders nice at 500x500, but while i render it into a bigger image, say 1000x1000, i got a white image with some little grey squares... :?

Posted: Tue Aug 02, 2005 3:07 pm
by MtnViewJohn
Having a slider that changes the border of an image that has already been generated is possible, but tricky. The border is composed of a fixed part and a variable part. The variable part is different for each edge. It would be much easier to have a slider that affects the next generated image but has no affect on the current image, even when you save it.

Posted: Tue Aug 02, 2005 11:28 pm
by lagroue
MtnViewJohn wrote:Having a slider that changes the border of an image that has already been generated is possible, but tricky. The border is composed of a fixed part and a variable part. The variable part is different for each edge. It would be much easier to have a slider that affects the next generated image but has no affect on the current image, even when you save it.
I'm so disappointed !
[troll]John : ask Mark, he uses a Mac and surely knows that live sliders are the thing to do these days...[/troll]
:cry: