rose+glassbox combo

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
fbo
Posts: 8
Joined: Sat Aug 13, 2005 2:54 am

rose+glassbox combo

Post by fbo »

As an exercise I combined the rose (by vino) and the glassboxes (by chris).
I cannot explain why the area around the stem of the rose has a different color.
BTW: ContextFree is an excellent program to use! Cut/paste and fiddle around in a very user friendly way. Hope to come up with something more original later on.

Code: Select all

startshape glasscubes //{color alpha}

include rose.cfdg

rule glasscubes {
cuberow {b 1 sat 0.8 hue 40 alpha -0.2}
cuberow {y 1.1 b 1 sat 0.5 hue 80 alpha -0.4}
cuberow {y 2.2 b 0.9 sat 0.1 hue 120 alpha -0.6}
plant {s 0.1}
plant {y 1.1 s 0.1}
plant {y 2.2 s 0.1}
}

rule cuberow {
cube {sat 0}
cube {x 1.1 sat 0.5 hue 90}
cube {x 2.2 sat 0.8 hue 200}
plant {s 0.1}
plant {x 1.1 s 0.1}
plant {x 2.2 s 0.1}
}

rule cube {
plant {s 0.1}
SQUARE {x 0.281 y 0.281 hue 240}
SQUARE [r 45 skew 45 0 x -0.5125 y 0.355 s 0.4 0.707 b -0.5 hue 120 ]
SQUARE [r -45 skew 0 45 x 0.355 y -0.5125 s 0.707 0.4 b -0.5 hue 40 ]
SQUARE [r 45 skew 45 0 x 0.9095 y -0.355 s 0.4 0.707 hue 80 ]
SQUARE [r -45 skew 0 45 x -0.355 y 0.9095 s 0.707 0.4 hue 160 ]
SQUARE { }
} 

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

Post by MtnViewJohn »

The rose stem is created using a hack that I saw on the CFDG Gallery site here. It is just white ellipse on top of a dark green ellipse. The effect only works in isolation. Once you put a rose on top of anything the white ellipse is visible. The hack is necessary because the kind of recursive curve that one would normally use for a stem ends up covering the flower petals, instead of being behind:

Code: Select all

rule stem {
	SQUARE {hue 120 sat 1 b 0.5}
	stem { y 0.9 s 0.95 r -1 }
}
We are trying to think of some ways to solve this class of problems without violating the spirit of context-free grammars. Your truck trail is cute. I look forward to seeing more. Please submit them to the gallery site.

Post Reply