|
|
I'm trying to make leafs falling of tree.
I have pig.png - containing photo of a leaf, with background marked s 100%
transparent, and hf.png containing png grayscale height-map for leaf.
Now, how can I create a leaf? I'm using height_field, and results are quite
good, but how to:
1) create an mesh from an height_field (do I have to build mesh manualy
i.e. as grid of say 200x200 points, height of each determinating by using
pigment_eval or simmilar? Bot still it would be hard to calculate normals
for smooth_triangle)
2) how can I cut away this black (100% transparent) background - how can I
make it 100% transparent?
about 1) - if ther isn't any macro doing so yet, I would like to try coding
it, hwo should I calculate normal for point P[x,y] when height of it's
neightbours are P[x-1,y] P[x,y-1] etc..., and distance between them is some
"h" vlue.
--
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M
Post a reply to this message
|
|