POV-Ray : Newsgroups : povray.advanced-users : Pattern showing *change* in slope : Re: Pattern showing *change* in slope Server Time
3 Jul 2024 06:00:23 EDT (-0400)
  Re: Pattern showing *change* in slope  
From: SharkD
Date: 28 Aug 2009 12:43:37
Message: <4a980939$1@news.povray.org>
clipka wrote:
> Sorry, I forgot that with that hf_function1 being a pigment function, 
> you'll need to evaluate a particular color component, so instead of
> 
>     hf_function1(...)
> 
> you need to write:
> 
>     hf_function1(...).grey
> 
> (or .red, .green or .blue, but if I'm not mistaken the height_field 
> object uses the combined grey value as well, so the same should be used 
> as the basis for the curvature computations.)

Thanks! However, all I see is black. Here are the relevant portions of 
my scene.

-Mike

//START
#local hf_pigment1 = pigment
{
	image_map {png "hf_big.png"}
	rotate x * 180		// flipped
}
#local hf_function1 = function {pigment {hf_pigment1}}

#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).gray + hf_function1(x + 
dv_D,y,z).gray - 2 * hf_function1(x,y,z).gray)
		+
		dv_Sqr(hf_function1(x,y - dv_D,z).gray + hf_function1(x,y - 
dv_D,z).gray - 2 * hf_function1(x,y,z).gray)
	)
}

height_field
{
	function 1024, 1024 {hf_function1(x,y,z).gray}
	smooth
	texture
	{
		pigment
		{
			function {dv_G(x,y,z)}
			color_map
			{
				[0 rgb 0]
				[1 rgb 1]
			}
		}
		finish {ambient 1}
	}
	translate <-1/2,0,-1/2,>
}
//END


Post a reply to this message

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