|
|
Alex Kluchikov <klk### [at] ukrnet> wrote in
news:1105_1060034693@news.povray.org:
> See p.b.i for corresponding post.
If you wan't to get rid of all the warnings, then
you can rewrite your macros like I have done below.
Tor Olav
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
#macro Ph(R1, R2, Rmin, Alpha)
#local L1 = Rmin*sin(Alpha);
#local H1 = (Rmin + R1)*sin(Alpha);
#local Rmaj = (Rmin + R1)*cos(Alpha);
#local H2 = sqrt(pow(Rmin + R2, 2) - pow(Rmaj, 2));
#local L2 = H2*Rmin/(R2 + Rmin);
union {
difference {
cylinder { -L1*y, L2*y, Rmaj }
torus { Rmaj, Rmin }
}
sphere { H2*y, R2 }
translate H1*y
}
#end // macro Ph
#macro Rack(X)
#local R1 = 1;
#local SS = seed(X);
union {
sphere { 0*y, R1 }
#local I = 0;
#while(I < 150)
#local R2 = 0.05 + 0.2*rand(SS);
#local Rmin = 0.1 + 0.5*rand(SS);
#local Alpha = radians(80 - 50*rand(SS));
#local Rmaj = (Rmin + R1)*cos(Alpha);
#local vRotate = 360*<rand(SS), rand(SS), rand(SS)>;
#if (Rmin < Rmaj & Rmaj < Rmin + R2)
object {
Ph(R1, R2, Rmin, Alpha)
rotate vRotate
}
#end // if
#local I = I + 1;
#end // while
}
#end // macro Rack
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
#declare TT = seed(876745);
#declare I = 0;
#while(I < 11)
#declare Dummy = rand(TT);
object {
Rack(345325 + 4536*I/10)
texture { st }
scale 0.4*<1, 1, 1>
translate 2*(2*<rand(TT), rand(TT), rand(TT)> - <1, 1, 1>)
}
#declare I = I + 1;
#end // while
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
Post a reply to this message
|
|