|
|
This is the code for my Snow image posted in p.b.i. It's *very* WIP so
not flexible and universal at all.
You will need a font file and a heightfield to render it as posted, the
macro should also work with other objects.
Christoph
// BEGIN POV code
//
// Snow macro WIP
//
// Christoph Hormann (28. Nov. 2000)
// chr### [at] gmxde
// http://www.schunter.etc.tu-bs.de/~chris/
#version unofficial MegaPov 0.6;
#include "colors.inc"
camera {
location <8.0, -8.0, 5.0>*2
direction z
sky z
up z
right 1.33333*x
look_at <0.0, 0.0, 0.0>
angle 38
}
light_source {
<20, -40, 28>
color rgb 1.4
}
#declare T_Snow_01=
texture {
pigment { color White }
finish {
ambient 0.1
diffuse 0.7
brilliance 0.8
specular 0.4
roughness 0.02
}
normal {
granite 0.2
scale 0.3
}
}
#macro Snow_02 (Object, Step, StartP, EndP)
blob {
threshold 0.6
#local Cnt_X = StartP.x;
#while (Cnt_X <= EndP.x)
#local Cnt_Y = StartP.y;
#while (Cnt_Y <= EndP.y)
#local Norm = <0, 0, 0>;
#local Pos = trace ( Object, <Cnt_X, Cnt_Y, 1000>, <0, 0, -1>, Norm
);
#local Pos = <Pos.x, Pos.y, Pos.z + Step>;
#if ((Norm.x != 0) | (Norm.y != 0) | (Norm.z != 0))
sphere { Pos, Step*3, 1 }
#end
#local Cnt_Y = Cnt_Y + Step;
#end
#local Cnt_X = Cnt_X + Step;
#end
texture {
T_Snow_01
}
}
#end
#declare Tx1=
texture {
pigment {
color rgb <0.9, 0.72, 0.5>
}
finish { diffuse 0.65 ambient 0.1 }
}
#declare Part_1=
union {
cylinder { < 0, 0, 0>, < 0, 0, 2.0>, 0.2 }
sphere { < 0, 0, 0> 1
scale <1,1,0.2>
translate 1*z
}
sphere { < 0, 0, 2.0>, 0.4 }
}
#declare Obj_X=
union {
superellipsoid {
<0.7, 0.1>
translate <4.0, -3.0, 0.0>
}
union {
box { <-2, -0.3, 1>, < 2, 0.3, 1.4> }
box { <-2, -0.3, 0>, <-1.6, 0.3, 1.2> }
box { <1.6, -0.3, 0>, < 2, 0.3, 1.2> }
scale 1.3
translate <4.0, -3.0, 0.0>
}
cylinder { <-2.5, -2, 0.5>, < 5, -7, 0.0>, 0.3 }
cylinder { <-3.5, -6, 0.0>, < 6, -8, 0.0>, 0.5 }
box { <-2, -2, 0>, < 2, 2, -1.2> translate <-2.5, -1.5, 0.0> }
box { <-0.4, -0.4, 0>, < 0.4, 0.4, 0.5> translate <-3.0, 2.0, 0.0> }
object {
text {
ttf
"f:\winnt\fonts\bgothm.ttf"
"SNOW"
0.2, 0
}
scale 3.6
rotate 90*x
translate <-2.85, 1.6, 0.2>
}
object { Part_1 scale 1.3 translate <-2.5, -2, 0.0> }
object { Part_1 scale 1.5 translate <0.5, 4, 0.2> }
torus
{
1.3,
0.3
rotate 90*x
scale <2.3, 2.3, 1>
translate <6.5, -2.6, 0.08>
}
torus
{
1.5,
0.3
scale <1, 3, 1>
translate <9.4, -2.6, 0.1>
}
texture { Tx1 }
translate <-2.0, 0.0, 0.0>
}
#declare Obj_Y=
object {
height_field {
png "G:\RAY\maps\Fantasy1.png"
water_level 0.0
smooth
}
rotate <-90, 0, 0 >
scale < 2, 2, -0.1 >
translate < -1,-1, 0 >
scale 22
translate < 0, 0, -1.9 >
rotate 45*z
texture {
object { box {<-22, -12, -10>, <12, 22, 10>}
texture { T_Snow_01 }
texture { Tx1 }
}
}
}
object { Obj_X }
object { Obj_Y }
Snow_02 (
union {
object { Obj_Y }
object { Obj_X }
}, 0.15, <-22, -12, 0>, <12, 22, 0>
)
// END POV code
Post a reply to this message
|
|