|
|
/**
* Idea to place waterdrops like on wet surfaces ...
* by Jan Walzer (Jan### [at] lzernet)
*
* needs megapov
*
* OK ... so far they are no real drops but they get near
* to the idea I got. They already need a lot of tweaking.
*
* The Idea is:
* Select from the area you want to cover some random points.
* determine the color of the Pigment, you want to use.
* This Color gives the Size of the Drop I'm placing, as well
* as the probability that it is appearing there. That makes
* (hopefully) not all the big drops clumping together...
* Of course, it is not sure, that they are not intersecting.
* Maybe it looks better if using blobs ...
*
* The best way would be, to take a better Texture for the Blobs.
*
* Some stats:
* Time for Coding the Idea : 15min
* Time for tweaking to the current result: 1:30h
* Time for Parse : 32sec
* Time for Render (1024x768,0.3 noRadio) : 230sec (20381 of
25000 drops placed)
* Peek mem : 100555737 Bytes
*
**/
camera{
location <0.0, 3, -2>
look_at <0.0, 0, 1.25>
angle 35
}
light_source
{
<3,20,10>
color rgb 1
}
#declare rd=seed(0);
#declare MyPigment =
pigment {
// granite scale 5
bozo scale 1
// wrinkles scale 1.2
// agate scale 2
file://crackle scale 1.2
// dents scale 1.5
// wood triangle_wave rotate <60,40,0> scale 2
color_map {
[0.1, color rgb <0.0,1,1>]
[0.65, color rgb <0.3,0,1>]
[0.7, color rgb <0.7,1,0>]
[0.9, color rgb <0.8,1,1>] }
scale 0.5
}
box {
<-10,0,-10>
<10,-1,10>
pigment {
checker color rgb 0,color rgb 0.1
}
}
#declare MyObject =
object {
sphere {0 0.6666}
scale <1,0.3,1>
}
#declare rd=seed(42);
#declare rd2=seed(23);
// Algorithm starts here...
#declare Num=25000;
#declare i=0;
#while (Num>0)
#declare Num=Num-1;
#declare Pos=<rand(rd)-0.5,0,rand(rd)>*5;
#declare Var=rand(rd2);
#declare colr=eval_pigment(MyPigment,Pos);
#declare sze=sqr(colr.x)*2;
#if ( sqr(sze) < Var * 2)
#declare i=i+1;
object { MyObject
scale sze*0.05+0.005
translate Pos
pigment {
color rgb colr
// MyPigment
}
}
#end
#end
#debug concat(str(i,0,0)+" drops placed\n")
--
--
,', Jan Walzer \V/ http://wa.lzer.net ,',
',',' student of >|< mailto:jan### [at] lzernet ',','
' ComputerScience /A\ +49-177-7403863 '
Post a reply to this message
|
|