POV-Ray : Newsgroups : povray.general : Slope pattern in function : Re: Slope pattern in function Server Time
6 Aug 2024 14:23:26 EDT (-0400)
  Re: Slope pattern in function  
From: Christopher James Huff
Date: 27 Feb 2002 19:13:22
Message: <chrishuff-99C645.19131627022002@netplex.aussie.org>
In article <3c7d1ca8@news.povray.org>, the### [at] webde (theVIPER) 
wrote:

> When a slope pattern based pigment is used in a function, it always returns
> the beginning of the color_map.
> This seems logical, because the function only has the position in space and
> not the normal vector.
> 
> Does anyone know a workaround (or dirty trick ;) for this?

The only thing I can think of would be to do *all* the calculations in 
the function. This would be fairly easy for simple objects like spheres, 
but very difficult for more complex ones. A height_field should be 
fairly easy to approximate, though.
The main problem is that the functions will be extremely complex, 
because functions currently can't handle vector expressions. This also 
means they will be quite slow...

Hmm...use the slope pattern with a black-white color_map, a finish with 
diffuse 0 and ambient 1, and render an image with that. Use that image 
as input to a function...and you have slope data available to functions! 
It'll only work for flat objects like height fields though.

Really, this information should be made available to functions...when a 
function pattern is evaluated on a surface, the ray and intersection 
information could be passed to it through predefined parameters like the 
xyz coordinates are now. The information could also be passed along to a 
pattern or pigment if applicable. If evaluated elsewhere, as media 
density for example, dummy information could be used.
However, actually writing the code for all this is a bit more work...

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/


Post a reply to this message

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