|
![](/i/fill.gif) |
clipka wrote:
> SharkD schrieb:
>> How can I create a pattern that shows the *change* in slope of a
>> heightfield. I.e., brighter where the "curvature" is greater.
>
> You can create this from the image you use for the height field
>
> To begin with, make a pigment from the image; make from that a function F.
>
> Now, create a function G computing the curvature from five function
> values from F, spaced apart by (at least) 1/BITMAP_SIZE, to compute the
> "difference in difference" both vertically and horizontally:
OK, here's what I have:
//START
#local hf_function1 = function {pigment {hf_pigment3}}
#local dv_D = 1/1024;
#local dv_Sqr = function(x) {x * x}
#local dv_G = function(x,y,z)
{
sqrt
(
dv_Sqr(hf_function1(x - dv_D,y,z) + hf_function1(x + dv_D,y,z) - 2 *
hf_function1(x,y,z))
dv_Sqr(hf_function1(x,y - dv_D,z) + hf_function1(x,y - dv_D,z) - 2 *
hf_function1(x,y,z))
)
}
//END
However, I get the error: "Parse Error: Expected '.', + found instead"
-Mike
Post a reply to this message
|
![](/i/fill.gif) |