POV-Ray : Newsgroups : povray.text.scene-files : L*C*h(uv) functions : Re: L*C*h(uv) functions Server Time
16 Apr 2024 06:53:07 EDT (-0400)
  Re: L*C*h(uv) functions  
From: Mike Horvath
Date: 21 Nov 2016 16:33:30
Message: <5833682a$1@news.povray.org>
On 11/21/2016 4:23 PM, clipka wrote:
> Am 21.11.2016 um 21:56 schrieb Mike Horvath:
>
>>>> Actually, I can create a pigment already. But I don't know how to use
>>>> the functions in a isosurface or a parametric to make the 3D object the
>>>> pigment gets applied to, if possible.
>>>>
>>>> Mike
>>>
>>> Oops! You'll need to know these as well.
>>>
>>> #declare correctRGB1 = function(R,G,B) {min(max(R,0),1)}
>>> #declare correctRGB2 = function(R,G,B) {min(max(G,0),1)}
>>> #declare correctRGB3 = function(R,G,B) {min(max(B,0),1)}
>>>
>>>
>>
>> That is wrong. The RGB values should *not* be corrected. In fact, if any
>> of R, G or B are outside the range of 0 to 1, then the coordinate/color
>> should be discarded. Sorry!
>
> So if I understand you correctly, the shape you want is exactly the
> volume for which R, G and B are all within the range from 0 to 1.
>

Yes, exactly!


> That sounds like a job for an isosurface to me.
>
> Variant A: Create six isosurfaces, each representing one of the
> boundaries (R<0, G<0, B<0, R>1, G>1, B>1), and intersect them.
>
> Variant B: Refactor the functions from variant A, so that they have the
> same threshold, combine them using max() or min() to achieve the
> intersection effect, and turn that into a single isosurface.
>

I don't know how to do either variant. :(

Mike


Post a reply to this message

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