home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
oct93
/
graphics
/
graphtal.lha
/
Graphtal
/
Examples
/
birchtree.anim.lsys
< prev
next >
Wrap
Text File
|
1992-11-03
|
3KB
|
141 lines
/*
* This L-system description file generates a birchtree.
*
* Copyright (C) 1992, Andrey Collison (collison@iam.unibe.ch)
* All rights reserved.
*/
lsystem birchtree;
const fact = 0.853; // branch length decrease rate
fact1 = 0.903; // trunk length decrease rate
len = 1.0;
xOffset = 2 - 4/numberOfFrames*iter;
/*
* Generate the trunk.
*/
table trunk {
S -> texture("texture bump .4 scale .15 .15 .025 " +
"texture bump .2 scale .01 .01 .01 " +
"texture fbm 0 16. .5 2. 6. 0 birchtrunk.map " +
"scale 0.2 0.2 0.04")
ro(-15) pt(6) co("AntiqueWhite") wi(len/8)
F(len) pt(-3) F(len)
T(len);
T(l) : l > 0.48 -> [
Bpitch Branch(l)
] Brot1
[
Bpitch Branch(l)
] Brot2
wi(l/9) pt(-2) Trunk(l) T(l*fact1);
T(l) : l <= 0.48 -> [
Bpitch Branch(l)
] Brot1
[
Bpitch Branch(l)
] Brot2
G(-len/1.5)
[
wi(l/12) [ pt(7) B(l*fact1) ]
ro(137) [ pt(10) B(l*fact1) ]
ro(70) [ pt(3) B(l*fact1) ]
];
Bpitch -> (0.33) pt(33)
-> (0.33) pt(47)
-> (0.34) pt(42);
Brot1 -> (0.33) ro(175)
-> (0.33) ro(190)
-> (0.34) ro(165);
Brot2 -> (0.33) ro(105)
-> (0.33) ro(95)
-> (0.34) ro(77);
Branch(l) -> (0.33) B(l)
-> (0.33) B(l*fact1)
-> (0.34) B(l*fact1*fact1);
Trunk(l) -> (0.33) F(l*1.07)
-> (0.33) F(l)
-> (0.34) F(l*0.93);
};
/*
* Generate branches and prepare the leafs.
*/
table branches {
B(l) : l > 0.32 -> pt(3) wi(l/20)
t(1,0,-0.5)
texture("") co("SaddleBrown",l) F(l)
[ BturnP Bpitch C(l*fact) ]
[ BturnN Bpitch C(l*fact) ]
B(l*fact*fact);
B(l) : l <= 0.32 -> pt(3) wi(l/20)
t(1,0,-0.5)
texture("") co("SaddleBrown",l) F(l)
[ BturnP Bpitch C(l*fact) ]
[ BturnN Bpitch C(l*fact) ]
C(l*fact);
C(l) : l > 0.18 -> wi(l/30)
texture("") co("SaddleBrown",l)
F(l*0.4) wi(fact*l/30) F(l*0.4)
[ tu(30) C(l*fact*fact) ]
[ ro(120) tu(40) C(l*fact*fact)]
[ ro(240) tu(25) C(l*fact*fact*fact) ]
[ Leafs ];
BturnN -> (0.5) tu(-67)
-> (0.5) tu(-82);
BturnP -> (0.5) tu(71)
-> (0.5) tu(80);
Bpitch -> (0.33) pt(-13)
-> (0.33) pt(-24)
-> (0.34) pt(-33);
};
/*
* Leafs
*/
table leafs {
Leafs -> wi(0.007) F(0.1)
Broll Leaf F(0.1)
Broll Leaf F(0.1)
Broll Leaf
[
co("SandyBrown") wi(0.011) F(0.1)
];
Leaf -> (0.25) [bpch lib("birchleaf1", 0.93)]
-> (0.25) [bpch lib("birchleaf2", 1.03)]
-> (0.25) [bpch lib("birchleaf3", 1.13)]
-> (0.25) ;
Broll -> (0.33) ro(137)
-> (0.33) ro(-9)
-> (0.34) ro(267);
bpch -> (0.33) pt(-30)
-> (0.33) pt(-23)
-> (0.34) pt(-47);
};
attributes {
axiom t(0,0,0) S;
derivation trunk(12), branches(10), leafs(2);
weight 0.2*M_E^(-((tx-xOffset)^2)/(2*0.1));
eye 0, 12, 4;
lookat 0, 0, 4;
};