|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 23 Jan 2004 13:23:13 -0500, "Rafal 'Raf256' Maj" <spa### [at] raf256com> wrote:
> 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)
IIRC familiy of HF* macros do that. See shapes.inc standard include file (and
manual).
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
abx### [at] abxartpl news:joq210dmca761mvhibm1ffd67baq7u3r7q@4ax.com
> IIRC familiy of HF* macros do that. See shapes.inc standard include
> file (and manual).
Thanks, I'll.
And bout cutting off backgound - using transparent 1 for black kolor will
*not* help, because then still finish would be used (specular, reflection).
Btw, how about 6-th component for color - ignore? <r,g,b,f,t,i>
It's purpose would be to work on finish-based-colors as transparent works
on colors.
I.e. rgbfti <1,1,1,0,1,0> would be a red with 100% trasmit, so only finish
(i.e. specular reflections) will make surface visible, and
rgbfti 1 would make it totaly invisible.
But I dont know is there sense to implementing it, because it's looks like
realy lots of work imho?
--
#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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
spa### [at] raf256com news:Xns9479C94105AB5raf256com@203.29.75.35
Well, the solution was realy easy - just use water_level in hf and black
background will dissapeare
--
#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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi Rafal,
I understand that you have already solved your problem, so this
may not be relevant anymore. I am working on some algorithms
to create and modify meshes. Up to now that is only closed
surfaces, but I can see no real problem in extending that to
non-closed surfaces, like leaves. If you have these pig.png and
hf.pnf files for me, I could try to generate a mesh of, say,
200 triangles for you. No garantees, however, it is something
I want to do anyway someday, but time is scarce (and I have
apart from my work a number of POV related problems to work on),
so even if I can do it, it might be ready long after you finished
this image. On the other hand it could be ready by monday.
You never know ;)
Andrel
Rafal 'Raf256' Maj wrote:
> 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.
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|