|
![](/i/fill.gif) |
pic.jpg is gray scale image and hf.jpg is the same but blurred.
#version 3.5;
camera {
orthographic
location <0,0,-1>
look_at <0,0,0>
right 1*x
up 1*y
}
background{rgb 1}
#declare Mark=
cylinder{-0.5*x,0.5*x,0.5 pigment{rgb<0,0,0>}
finish{ambient 0 diffuse 0}}
#declare V=
function{
pigment{
image_map{jpeg "pic.jpg" interpolate 2}
translate -0.5
}
}
#declare HF=
height_field{jpeg "hf.jpg" translate<-0.5,-1,-0.5> rotate -90*x
pigment{gradient -z} finish{diffuse 0 ambient 1}
}
#declare Normal=<0,0,0>;
#declare Div=0.01;
#declare S=seed(4);
#declare X=-0.5;#while(X<0.5)
#declare Y=-0.5;#while(Y<0.5)
#declare tmp=trace(HF, <X,Y,-2>, z, Normal);
#declare n1=vnormalize(Normal);
#declare Normal=n1;
#declare I=max((1-(V(X,Y,0).red*0.6)),0)^5;
#if(sqrt((Normal.x)^2+(Normal.y)^2)>0.0001)
object{
Mark scale<Div*4*(1-I/2),Div*I,Div*I>+Div/100
rotate z*(degrees(atan2(Normal.y,Normal.x))+90+10-rand(S)*20)
translate<X+Div/2-rand(S)*Div,Y+Div/2-rand(S)*Div,X+Y+1>
}
#else
object{
Mark scale<Div*4*(1-I/2),Div*I,Div*I>+Div/100
rotate z*360*rand(S)
translate<X+Div/2-rand(S)*Div,Y+Div/2-rand(S)*Div,X+Y+1>}
#end
#declare Y=Y+Div;#end
#declare X=X+Div;#end
_____________
Kari Kivisalo
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 6 Feb 2002 09:39:45 -0000, "Gleb" <gk1### [at] soton ac uk> wrote:
> //#if(sqrt((Normal.x)^2+(Normal.y)^2)>0.0001)
> #if(((Normal.x)^2+(Normal.y)^2)>0.01)
>
> it is OK
afaik you have moved comma in wrong direction
(or it was intentional increase of epsilon)
ABX
Post a reply to this message
|
![](/i/fill.gif) |