Quad Green Satellite

If you have a design you're proud of, share the cfdg file here. It's also a good place to ask for feedback and collaborate.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Quad Green Satellite

Post 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 } }

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Post 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 } }

grimace
Posts: 9
Joined: Fri Jul 29, 2005 1:48 am

Post by grimace »

That's wicked!

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Post by lagroue »

I'm so glad with these rules I made a desktop background of it.

Image
Image
Last edited by lagroue on Fri Jul 29, 2005 12:27 pm, edited 1 time in total.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

There should be a way to suppress the white borders for cfdg files that look better without them.

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Post 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 !

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post 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.

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Post 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)

momo
Posts: 53
Joined: Tue Jul 19, 2005 5:08 am

Post 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... :?

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post 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.

User avatar
lagroue
Posts: 114
Joined: Wed Jul 06, 2005 11:33 pm
Location: Paris, France
Contact:

Post 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:

Post Reply