|
![](/i/fill.gif) |
Jerry wrote:
>
> In article <38CC002C.6DBE9012@merlin.net.au>, PoD <pod### [at] merlin net au>
> wrote:
> >Show me a simple syntax that lets you create a tree with different
> >textures for trunk, branches, twigs, leaves, fruit, flowers.
> >And has declarations of objects to use for the above.
>
> Well, I'd separate out a simple IFS from full-blown LSystem, since it
> ought to be easier (and happens to be what I'm interested in :*)
Ok, I did say trees rather than L-Systems.
>
> #declare deadSeed = seed(99);
> #declare tree = ifs {
> children 3 //number of children that bloom from each 'branch'
> angles {
> <30,0,0>, <0,60,60>, <0,30,0>
> } //angle change for each child
> sizes {
> <.8,.75,.75>, <.6,1,1>, <.5,.5,.5>
> } //size change for each child
Distances?
Here, all children go at the end of the parent, I assume.
Hm. yeah you can do it that way if a continuation of the branch is a
special child.
> deadends {
> deadSeed
> .1,.05,.05
> } //chance of a dead end for each iteration, as well as the
> //seed to use for randomness
> levels 5
> level_map {
> [1-2 texture { trunknbranches }]
> [3 texture { greentrees }]
> [4 texture { greenleaves }]
> [5 texture { flowers }]
> } //might also use a 0-1 range
I think these need to be objects rather than textures.
> method dot_approximation //I've forgotten the name of this
Not sure what you mean here.
> //other method would be to draw every piece
> turbulence .25
> //turbulence might not be the right keyword; might have to
> //be separated into 'angle_turb' and 'size_turb'.
Probably should be per-level.
> //some items might not be able to be applied to some methods
> //also, a completely separate 'flower' object might not be a bad idea:
> //flower { object { treeFlower } }
> //which goes on the end of any branch that makes it to the top level
> }
>
> Have I forgotten any necessary information?
>
> Jerry
Sounds like it probably should be called tree{} rather than ifs{}
though.
Some other things.
Leaves tend to all be at the same angle to the ground (except in plants
where they're not), so you'd have to be able to specify that. Same for
flowers.
PoD.
Post a reply to this message
|
![](/i/fill.gif) |