POV-Ray : Newsgroups : povray.text.scene-files : L*C*h(uv) functions Server Time
16 Apr 2024 16:22:38 EDT (-0400)
  L*C*h(uv) functions (Message 17 to 26 of 26)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Mike Horvath
Subject: Re: L*C*h(uv) functions
Date: 22 Nov 2016 02:45:52
Message: <5833f7b0$1@news.povray.org>
On 11/22/2016 2:44 AM, clipka wrote:
> Am 22.11.2016 um 08:33 schrieb Mike Horvath:
>
>>>     convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x/z)*pi/180)
>
>> THANK YOU!!
>>
>> However atan2 requires two parameters and your math only has one.
>
> Sorry, try atan2(x,z).
>

Here is the whole file again with your changes. The shape I get when I 
render is that of a pointy cap. I don't know if that's correct or not.


Mike


Post a reply to this message


Attachments:
Download 'utf-8' (7 KB)

From: clipka
Subject: Re: L*C*h(uv) functions
Date: 22 Nov 2016 03:31:26
Message: <5834025e$1@news.povray.org>
Am 22.11.2016 um 08:45 schrieb Mike Horvath:
> On 11/22/2016 2:44 AM, clipka wrote:
>> Am 22.11.2016 um 08:33 schrieb Mike Horvath:
>>
>>>>     convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x/z)*pi/180)
>>
>>> THANK YOU!!
>>>
>>> However atan2 requires two parameters and your math only has one.
>>
>> Sorry, try atan2(x,z).
>>
> 
> Here is the whole file again with your changes. The shape I get when I
> render is that of a pointy cap. I don't know if that's correct or not.

How would I know -- I'm not familiar with that colour model.

Now you need to intersect that shape with the five others -- or use the
combined function:

    min(
      convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
      convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
      convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
      1-convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
      1-convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
      1-convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180)
    )

should do the job, I think.


Post a reply to this message

From: Mike Horvath
Subject: Re: L*C*h(uv) functions
Date: 22 Nov 2016 03:43:51
Message: <58340547$1@news.povray.org>
On 11/22/2016 3:31 AM, clipka wrote:
>     min(
>       convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       1-convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       1-convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       1-convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180)
>     )

I think the last parameter should be atan2(x,z)*180/pi because atan2 
returns radians and convertLCH2RGB_R expects degrees.

Also, here's a rough approximation of what the surface should look like.

https://commons.wikimedia.org/wiki/File:Cielch_color_solid_cylinder.png

But with smooth curves instead of blocky sections.

Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: L*C*h(uv) functions
Date: 22 Nov 2016 03:44:21
Message: <58340565$1@news.povray.org>
On 11/22/2016 3:31 AM, clipka wrote:
>     min(
>       convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       1-convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       1-convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       1-convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180)
>     )


Forgot to say that the above just results in a cube.

Mike


Post a reply to this message

From: clipka
Subject: Re: L*C*h(uv) functions
Date: 22 Nov 2016 04:44:39
Message: <58341387$1@news.povray.org>
Am 22.11.2016 um 09:43 schrieb Mike Horvath:
> On 11/22/2016 3:31 AM, clipka wrote:
>>     min(
>>       convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>       convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>       convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>       1-convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>       1-convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>       1-convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180)
>>     )
> 
> I think the last parameter should be atan2(x,z)*180/pi because atan2
> returns radians and convertLCH2RGB_R expects degrees.

I guess you're right about this one.


Post a reply to this message

From: Mike Horvath
Subject: Re: L*C*h(uv) functions
Date: 22 Nov 2016 19:59:20
Message: <5834e9e8$1@news.povray.org>
On 11/22/2016 4:44 AM, clipka wrote:
> Am 22.11.2016 um 09:43 schrieb Mike Horvath:
>> On 11/22/2016 3:31 AM, clipka wrote:
>>>     min(
>>>       convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>>       convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>>       convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>>       1-convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>>       1-convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>>       1-convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180)
>>>     )
>>
>> I think the last parameter should be atan2(x,z)*180/pi because atan2
>> returns radians and convertLCH2RGB_R expects degrees.
>
> I guess you're right about this one.
>

I am also not sure if using atan2 is good, since that only covers 90 
degrees, whereas the hue circle must use all 360 degrees.

Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: L*C*h(uv) functions
Date: 22 Nov 2016 20:11:33
Message: <5834ecc5@news.povray.org>
On 11/22/2016 7:59 PM, Mike Horvath wrote:
> On 11/22/2016 4:44 AM, clipka wrote:
>> Am 22.11.2016 um 09:43 schrieb Mike Horvath:
>>> On 11/22/2016 3:31 AM, clipka wrote:
>>>>     min(
>>>>       convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>>>       convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>>>       convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>>>
>>>> 1-convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>>>
>>>> 1-convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>>>>       1-convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180)
>>>>     )
>>>
>>> I think the last parameter should be atan2(x,z)*180/pi because atan2
>>> returns radians and convertLCH2RGB_R expects degrees.
>>
>> I guess you're right about this one.
>>
>
> I am also not sure if using atan2 is good, since that only covers 90
> degrees, whereas the hue circle must use all 360 degrees.
>
> Mike

Sorry. Disregard that. It works.

Mike


Post a reply to this message

From: clipka
Subject: Re: L*C*h(uv) functions
Date: 22 Nov 2016 20:53:03
Message: <5834f67f$1@news.povray.org>
Am 23.11.2016 um 02:11 schrieb Mike Horvath:

>> I am also not sure if using atan2 is good, since that only covers 90
>> degrees, whereas the hue circle must use all 360 degrees.
>>
>> Mike
> 
> Sorry. Disregard that. It works.

That's the fun thing about `atan2(a,b)`: In contrast to `atan(a/b)` it
doesn't lose the information about the quadrant; it also avoids the
singularity at b=0 (provided a<>0).


Post a reply to this message

From: Mike Horvath
Subject: Re: L*C*h(uv) functions
Date: 23 Nov 2016 02:47:09
Message: <5835497d$1@news.povray.org>
On 11/22/2016 3:31 AM, clipka wrote:
>> Here is the whole file again with your changes. The shape I get when I
>> render is that of a pointy cap. I don't know if that's correct or not.
>
> How would I know -- I'm not familiar with that colour model.
>
> Now you need to intersect that shape with the five others -- or use the
> combined function:
>
>     min(
>       convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       1-convertLCH2RGB_R(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       1-convertLCH2RGB_G(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180),
>       1-convertLCH2RGB_B(y*200-100,sqrt(x*x+z*z)*100,atan2(x,z)*pi/180)
>     )
>
> should do the job, I think.
>

Using "min" all I got was a cube. Switching to "max" instead, I got a 
shape... of some sort. I'm not sure it's the correct one. Check the 
thread in p.b.i and tell me if the images show the same object.

http://news.povray.org/583548b6%40news.povray.org

Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: L*C*h(uv) functions
Date: 23 Nov 2016 02:48:47
Message: <583549df$1@news.povray.org>
I've attached the latest version of the script.

Mike


Post a reply to this message


Attachments:
Download 'cielch_color_solid_cylinder_isosurface.pov.txt' (9 KB)

<<< Previous 10 Messages Goto Initial 10 Messages

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