If you're having trouble using Context Free or don't understand the language, ask for help here.
Moderators: MtnViewJohn , chris , mtnviewmark
philomel
Posts: 2 Joined: Wed Oct 04, 2006 12:00 am
Post
by philomel » Wed Oct 04, 2006 12:02 am
Hi, I just needed a little bit of help on getting a project I'm working on to look right, but I can't seem to come up with the code to make delicate star shaped petals on the edges of the branches in the code. Any suggestions?
Code: Select all
startshape TREES
background { hue 110.3 sat 0.7 b 0.9 }
rule TREES {
BRANCH { }
BRANCH { flip 90 }
}
rule SHAPE { SQUARE { } }
rule SHAPE 0.01 {
SQUARE { }
}
rule BRANCH {
SHAPE { hue 38.3 sat 0.9 b 0.4 }
BRANCH { y 0.90 s 0.99 r 0.5 }
}
rule BRANCH 0.08 {
BRANCH { flip 85 }
}
rule BRANCH 0.32 {
BRANCH { flip 90 }
}
rule BRANCH 0.01 {
BRANCH {flip 90}
}
rule BRANCH 0.25 {
BRANCH {flip 90}
}
rule BRANCH 0.05 {
BRANCH { s 0.85 r 15 }
BRANCH { s 0.80 r -15 }
}
What commands do I need to enter?
MtnViewJohn
Site Admin
Posts: 882 Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:
Post
by MtnViewJohn » Thu Oct 05, 2006 12:08 am
Try this:
Code: Select all
startshape redflower
rule arc {
75* { r 1 x 0.1 } TRIANGLE {r -7}
}
rule petal {
arc {r -36.5}
arc {flip 0 r 36.5}
petal {sat -0.025 s 0.95 x -0.025}
}
rule flower {
5* {r 72} petal{}
}
rule redflower {
flower {b 0.9 sat 0.9 h 60 r 36 s 0.1 z 1}
flower {b 1 sat 1}
}
philomel
Posts: 2 Joined: Wed Oct 04, 2006 12:00 am
Post
by philomel » Tue Oct 17, 2006 1:15 pm
OK, we've got these two together...now how do we link them? Everytime I try to link up the codes, I get black arcs. What am I doing wrong here?
Joe
MtnViewJohn
Site Admin
Posts: 882 Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:
Post
by MtnViewJohn » Tue Oct 17, 2006 2:31 pm
I added this code to the end of your cfdg file:
Code: Select all
rule BRANCH 0.01 {
redflower{r 36}
BRANCH {}
}
rule arc {
75* { r 1 x 0.1 } TRIANGLE {r -7}
}
rule petal {
arc {r -36.5}
arc {flip 0 r 36.5}
petal {sat -0.025 s 0.95 x -0.025}
}
rule flower {
5* {r 72} petal{}
}
rule redflower {
flower {b 0.9 sat 0.9 h 60 r 36 s 0.1 z 1}
flower {b 1 sat 1}
}