POV-Ray : Newsgroups : povray.advanced-users : Pattern showing *change* in slope : Re: Pattern showing *change* in slope Server Time
3 Jul 2024 05:22:02 EDT (-0400)
  Re: Pattern showing *change* in slope  
From: SharkD
Date: 28 Aug 2009 12:05:34
Message: <4a98004e$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.