![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hello,
I'am playing with ridgedfm heightfield and I'am trying
to place some "trees" (cylinders, right now ;-) on it.
But something is wrong: when I made box, sphere,
isosurface with function { y } instead of heightfield,
it works. When I use ridgedmf, or noise, or pigment
in fuction it is unable to fund intersection of rays
with hf. But is heightfield itself displays correctly.
Any idea, what I'am doing bad?
Thanks
Disnel
Source code of testing scene:
#version unofficial MegaPov 0.5;
camera {
location <10, 10, -10>
angle 20
look_at <0, 0, 0>
}
light_source {< 100, 100, -50> color rgb 1}
light_source {<-100, 100, -50> color rgb .5}
#default {
texture {
pigment {color rgb 1}
finish {ambient 0 diffuse .8}
}
}
//background {color rgb .7}
#declare H=1.0;
#declare Lac=1.5;
#declare Octs=12;
#declare Offset=0.0;
#declare T=1.0;
#declare HF_Func=function {"heteroMF",<H, Lac, Octs, Offset, T> }
#declare Landscape=
isosurface{
function{y - HF_Func(x,0,z) + 1 }
eval
contained_by { box {<-2, -2, -2>, <2, 0, 2>} }
scale <1, .4, 1>
}
//#declare Landscape=box {<-2, -1, -2>, <2, 0, 2>}
//#declare Landscape=sphere {<0, -10, 0>, 10}
object {Landscape}
#declare Step_x=0.3;
#declare Step_z=0.3;
#declare Max_x=2;
#declare Max_z=2;
#declare Tree=
cylinder {
<0, 0, 0>, <0, .25, 0>, .02
texture {
pigment {color rgb <.5, 1, .5>}
}
}
#macro PlaceTree(px, pz)
#local Normal=<0, 0, 0>;
#local Where=trace(Landscape, <px, 10, pz>, <0, -1, 0>, Normal);
#if (Normal.x = 0 & Normal.y = 0 & Normal.z = 0)
#warning "Tree not placed\n"
#else
object {Tree translate Where}
#end
#end
#local px=0;
#while (px < Max_x)
#local pz=0;
#while (pz < Max_z)
PlaceTree(px, pz)
#if (px > 0)
PlaceTree(-px, pz)
#if (pz > 0)
PlaceTree(-px, -pz)
#end
#end
#if (pz > 0)
PlaceTree(px, -pz)
#end
#local pz=pz+Step_z;
#end
#local px=px+Step_x;
#end
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
The problem is due to the fact that you use the same variable
names in the macro and in the loop. This works :
#macro PlaceTree(ax, az)
#local Normal=<0, 0, 0>;
#local Where = trace(Landscape, <ax, 10, az>, <0, -1, 0>, Normal);
#if (Normal.x = 0 & Normal.y = 0 & Normal.z = 0)
#warning "Tree not placed\n"
#else
object {Tree translate Where}
#end
#end
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I don't think so. It works when I replace isosurface with
box or sphere (and I think, that px and pz are declared locally
in macro). And it does not work when I replace them with
ax or az, as you wrote.
Which version od MegaPOV are you using? I use Linux version.
Fabien Mosen wrote:
>
> The problem is due to the fact that you use the same variable
> names in the macro and in the loop. This works :
>
> #macro PlaceTree(ax, az)
> #local Normal=<0, 0, 0>;
> #local Where = trace(Landscape, <ax, 10, az>, <0, -1, 0>, Normal);
> #if (Normal.x = 0 & Normal.y = 0 & Normal.z = 0)
> #warning "Tree not placed\n"
> #else
> object {Tree translate Where}
> #end
> #end
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
... and it also works with isosurface sphere....
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <39747813.ECD7B37A@itam.cas.cz>, Vaclav Cermak
<dis### [at] itam cas cz> wrote:
> I'am playing with ridgedfm heightfield and I'am trying
> to place some "trees" (cylinders, right now ;-) on it.
> But something is wrong: when I made box, sphere,
> isosurface with function { y } instead of heightfield,
> it works. When I use ridgedmf, or noise, or pigment
> in fuction it is unable to fund intersection of rays
> with hf. But is heightfield itself displays correctly.
Try increasing the accuracy of the isosurface.
--
Christopher James Huff - Personal e-mail: chr### [at] mac com
TAG(Technical Assistance Group) e-mail: chr### [at] tag povray org
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Disnel wrote:
>
> I don't think so. It works when I replace isosurface with
> box or sphere (and I think, that px and pz are declared locally
> in macro). And it does not work when I replace them with
> ax or az, as you wrote.
>
> Which version od MegaPOV are you using? I use Linux version.
>
> Fabien Mosen wrote:
> >
> > The problem is due to the fact that you use the same variable
> > names in the macro and in the loop. This works :
> >
> > #macro PlaceTree(ax, az)
> > #local Normal=<0, 0, 0>;
> > #local Where = trace(Landscape, <ax, 10, az>, <0, -1, 0>, Normal);
> > #if (Normal.x = 0 & Normal.y = 0 & Normal.z = 0)
> > #warning "Tree not placed\n"
> > #else
> > object {Tree translate Where}
> > #end
> > #end
Another problem is that "Normal" is a reserved word. When I changed it
to something else (such as "Norm"), it worked.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Wed, 19 Jul 2000 12:09:19 -0600, Tim Riley wrote:
>Another problem is that "Normal" is a reserved word. When I changed it
>to something else (such as "Norm"), it worked.
Is not. Reserved words don't have capital letters in them. Try it as
posted and see if it works that way.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Disnel wrote:
>
> I don't think so. It works when I replace isosurface with
> box or sphere (and I think, that px and pz are declared locally
> in macro). And it does not work when I replace them with
> ax or az, as you wrote.
At least, once I did that, it worked fine...
otherwise it didn't...
> Which version od MegaPOV are you using? I use Linux version.
Win version, MegaPOV 0.5A
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Ron Parker wrote:
>
> On Wed, 19 Jul 2000 12:09:19 -0600, Tim Riley wrote:
> >Another problem is that "Normal" is a reserved word. When I changed it
> >to something else (such as "Norm"), it worked.
>
> Is not. Reserved words don't have capital letters in them. Try it as
> posted and see if it works that way.
I tried it as posted, then changed the variable names in the PlaceTree
macro as suggested; neither would work (Normal was always equal to <0,0,0>).
When I changed the variable name to Norm, it did work (placed a tree at
each point). I realize that "normal" is reserved, but I can't explain why
"Norm" works and "Normal" does not.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>
> Try increasing the accuracy of the isosurface.
>
Already tried 0.0000000001, no success.....
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |