![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 11/18/2016 8:37 AM, Christian Froeschlin wrote:
> I assume you already have a formula to convert the color space to sRGB.
>
Actually, I have a formula to convert a *single* color vector from LCH
to sRGB.
https://github.com/THEjoezack/ColorMine/blob/master/ColorMine/ColorSpaces/Conversions/LchConverter.cs
But I don't know how to convert this to one of POV-Ray's functions.
Mike
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Le 18/11/2016 à 08:22, Mike Horvath a écrit :
> I would like to create a three-dimensional representation of the
> L*C*h(uv) color space in the form of a cylinder.
>
> How would I do that?
>
> I may limit myself to colors that also exist in the sRGB color space.
>
> Mike
I would go via the fresh uv-mapping of cylinder, using a gradient map to
other gradient map of orthogonal direction.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Le 18/11/2016 à 19:25, Le_Forgeron a écrit :
> Le 18/11/2016 à 08:22, Mike Horvath a écrit :
>> I would like to create a three-dimensional representation of the
>> L*C*h(uv) color space in the form of a cylinder.
>>
>> How would I do that?
>>
>> I may limit myself to colors that also exist in the sRGB color space.
>>
>> Mike
>
> I would go via the fresh uv-mapping of cylinder, using a gradient map to
> other gradient map of orthogonal direction.
>
Here illustrated with a lemon, and HSL2RGB.
The adaptation to a cylinder and L*C*h(uv) is left as an exercise for
the reader.
Post a reply to this message
Attachments:
Download 'lemon.pov.txt' (1 KB)
Download 'lemon.png' (74 KB)
Preview of image 'lemon.png'
![lemon.png](/povray.advanced-users/attachment/%3C583004fe%40news.povray.org%3E/lemon.png?ttop=427553&toff=100&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 11/19/2016 2:53 AM, Le_Forgeron wrote:
> Le 18/11/2016 à 19:25, Le_Forgeron a écrit :
>> I would go via the fresh uv-mapping of cylinder, using a gradient map to
>> other gradient map of orthogonal direction.
>>
>
> Here illustrated with a lemon, and HSL2RGB.
>
> The adaptation to a cylinder and L*C*h(uv) is left as an exercise for
> the reader.
>
I want to model the 3D shape of the color solid, too. This is a very
irregular shape, and I believe I will need to create an isosurface.
Mike
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Let's start with a relatively simpler example of converting CIE XYZ to
sRGB. The following function is copied from here:
https://github.com/THEjoezack/ColorMine/blob/master/ColorMine/ColorSpaces/Conversions/XyzConverter.cs
internal static IRgb ToColor(IXyz item)
{
// (Observer = 2°, Illuminant = D65)
var x = item.X / 100.0;
var y = item.Y / 100.0;
var z = item.Z / 100.0;
var r = x * 3.2406 + y * -1.5372 + z * -0.4986;
var g = x * -0.9689 + y * 1.8758 + z * 0.0415;
var b = x * 0.0557 + y * -0.2040 + z * 1.0570;
r = r > 0.0031308 ? 1.055 * Math.Pow(r, 1 / 2.4) - 0.055 :
12.92 * r;
g = g > 0.0031308 ? 1.055 * Math.Pow(g, 1 / 2.4) - 0.055 :
12.92 * g;
b = b > 0.0031308 ? 1.055 * Math.Pow(b, 1 / 2.4) - 0.055 :
12.92 * b;
return new Rgb
{
R = ToRgb(r),
G = ToRgb(g),
B = ToRgb(b)
};
}
I think it would be pretty easy to produce a macro that does all of the
above. But how do I turn that into a POV-Ray function? The function
needs to work as a color as well as an isosurface I think.
Mike
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Le 19/11/2016 à 18:43, Mike Horvath a écrit :
> On 11/19/2016 2:53 AM, Le_Forgeron wrote:
>> Le 18/11/2016 à 19:25, Le_Forgeron a écrit :
>>> I would go via the fresh uv-mapping of cylinder, using a gradient map to
>>> other gradient map of orthogonal direction.
>>>
>>
>> Here illustrated with a lemon, and HSL2RGB.
>>
>> The adaptation to a cylinder and L*C*h(uv) is left as an exercise for
>> the reader.
>>
>
> I want to model the 3D shape of the color solid, too. This is a very
> irregular shape, and I believe I will need to create an isosurface.
for once, I would go for mesh
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Le 19/11/2016 à 18:47, Mike Horvath a écrit :
>
> I think it would be pretty easy to produce a macro that does all of the
> above. But how do I turn that into a POV-Ray function? The function
> needs to work as a color as well as an isosurface I think.
Basic of povray: the shape is not bound to the texture (excepted for
uv_mapping).
Make the work for the shape, and separately the work to map 3D
coordinates to colour.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 11/19/2016 12:59 PM, Le_Forgeron wrote:
> Le 19/11/2016 à 18:47, Mike Horvath a écrit :
>>
>> I think it would be pretty easy to produce a macro that does all of the
>> above. But how do I turn that into a POV-Ray function? The function
>> needs to work as a color as well as an isosurface I think.
>
>
> Basic of povray: the shape is not bound to the texture (excepted for
> uv_mapping).
>
> Make the work for the shape, and separately the work to map 3D
> coordinates to colour.
>
Okay. But how?
Mike
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Le 19/11/2016 à 19:19, Mike Horvath a écrit :
> On 11/19/2016 12:59 PM, Le_Forgeron wrote:
>> Le 19/11/2016 à 18:47, Mike Horvath a écrit :
>>>
>>> I think it would be pretty easy to produce a macro that does all of the
>>> above. But how do I turn that into a POV-Ray function? The function
>>> needs to work as a color as well as an isosurface I think.
>>
>>
>> Basic of povray: the shape is not bound to the texture (excepted for
>> uv_mapping).
>>
>> Make the work for the shape, and separately the work to map 3D
>> coordinates to colour.
>>
>
> Okay. But how?
Within the attached include file, you could replace uv_vertex with your
computed position.
The top macro is UVMeshable, first parameter is an object, just
ignore/remove it
The two others are the resolutions... you can simplify too for your
usage (getting ride of uv_min & uv_max).
mesh{
UVMeshable...
then you insert the uv_mapped texture (and I already provided some code
for that part in this thread)
et voila.
Post a reply to this message
Attachments:
Download 'nurbsmesh.inc.txt' (2 KB)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 11/19/2016 3:25 PM, Le_Forgeron wrote:
> Le 19/11/2016 à 19:19, Mike Horvath a écrit :
>> On 11/19/2016 12:59 PM, Le_Forgeron wrote:
>>> Le 19/11/2016 à 18:47, Mike Horvath a écrit :
>>>>
>>>> I think it would be pretty easy to produce a macro that does all of the
>>>> above. But how do I turn that into a POV-Ray function? The function
>>>> needs to work as a color as well as an isosurface I think.
>>>
>>>
>>> Basic of povray: the shape is not bound to the texture (excepted for
>>> uv_mapping).
>>>
>>> Make the work for the shape, and separately the work to map 3D
>>> coordinates to colour.
>>>
>>
>> Okay. But how?
>
> Within the attached include file, you could replace uv_vertex with your
> computed position.
>
> The top macro is UVMeshable, first parameter is an object, just
> ignore/remove it
> The two others are the resolutions... you can simplify too for your
> usage (getting ride of uv_min & uv_max).
>
> mesh{
> UVMeshable...
>
> then you insert the uv_mapped texture (and I already provided some code
> for that part in this thread)
>
> et voila.
>
I will try to get your method to work. However, it seems like it is more
effort than simply using an isosurface. I am not worried much about
performance.
Mike
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |