|
![](/i/fill.gif) |
On 1/17/2016 11:07 PM, Mike Horvath wrote:
> I created the following pigment to be used with ChromaDepth glasses:
>
> pigment
> {
> gradient vnormalize(Camera_Location - Camera_LookAt) * -1
> color_map
> {
> [0/4 srgb <1,0,0,>]
> [1/4 srgb <1,1,0,>]
> [2/4 srgb <0,1,0,>]
> [3/4 srgb <0,1,1,>]
> [4/4 srgb <0,0,1,>]
> }
> scale vlength(Camera_Location - Camera_LookAt) * 100
> translate Camera_Location
> }
>
> However, the relationship between distance and color is linear in my
> example. How do I change this so that the hue is based on atan(distance
> from camera)? Thanks!
>
>
> Mike
I am now using a macro.
#macro MakeChromadepthTexture(CameraLocation, CameraLookAt)
pigment
{
spherical
color_map
{
#for (i, 0, 240, 1)
[i/240 color rgb CHSL2RGB(<240 - i, 1, 1/2>)]
#end
}
}
// finish
// {
// ambient 1
// diffuse 0
// }
scale vlength(CameraLocation - CameraLookAt) * 2
translate CameraLocation
#end
But my question is the same. How do I replace `spherical` with
`atan(distance from camera)`? Possibly, the camera measurements will no
longer be necessary.
Thanks.
Mike
Post a reply to this message
|
![](/i/fill.gif) |