|
|
spa### [at] raf256com news:Xns95A7C1F4A1CCEraf256com@203.29.75.35
> sphere { 0 1 pigment { resr2_map1(0.3) } }
Ofcourse the "0.3" is returned by a macro co I cant caluclate it "by hand".
Also, I came up with a trick - put somewhere a cone with gradient y and
this color map and user trace() to get color for given value, but this dont
seem as a nice trick, does it?
--
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics
Post a reply to this message
|
|
|
|
"Rafal 'Raf256' Maj" <spa### [at] raf256com> wrote:
> I have a color map like:
>
> #declare resr2_map1 = // power + -
> color_map {
> [0.00 rgb z]
> [0.25 rgb z*.4 + .4 + .1*x]
> [0.50 rgb 1]
> [0.75 rgb x*.4 + .4 + .1*z]
> [1.00 rgb x]
> }
>
> now I want to do sometghing like:
>
> sphere { 0 1 pigment { resr2_map1(0.3) } }
>
> - to take color of value 0.3 from that color map and use it.
>
> Is there any beter way of doing this other then writting statement like:
>
> sphere { 0 1
> pigment { function { 0.3 } color_map{ resr2_map1 } }
> }
>
> ?
I'd tend to use a spline instead for this sort of thing, ie
#declare resr2_map1 = // power + -
spline {
linear_spline
0.00, z
0.25, z*.4 + .4 + .1*x
0.50, 1
0.75, x*.4 + .4 + .1*z
1.00, x
}
#declare C = 0; #while (C <= 10)
sphere { 0, 1
pigment { rgb resr2_map1(C/10) }
finish { ambient 1 diffuse 0 }
scale <0.2,2,1> translate <(C-5)/2.5,0,5>
}
#declare C = C + 1; #end
Hope this helps,
Mike Andrews.
>
>
>
> --
> http://www.raf256.com/3d/
> Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
> Computer Graphics
Post a reply to this message
|
|