|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
If a>b, it's c, else it's evaluated as d.
I cannot find this function. what's it' called?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> If a>b, it's c, else it's evaluated as d.
>
> I cannot find this function. what's it' called?
select?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Nicolas Alvarez wrote:
> Greg M. Johnson escribió:
>> If a>b, it's c, else it's evaluated as d.
>>
>> I cannot find this function. what's it' called?
>
> select?
Thanks.
I went and tried a #macro anyway, and it doesn't work.
#macro hiloer(jay)
#if (jay<0.5)
(0+0.5*(1-sqrt(1-jay*jay*4))
#else
(0+jay)
#end
#end
#declare n=0;
#while (n<1)
#declare aya=(hiloer(n)):
sphere{<n,3*n*n-2*n*n*n ,3>,0.01 pigment{red 1} finish{ambient 1}}
sphere{<n,0.5+0.5*cos(pi+n*pi),3>,0.01 pigment{green 1} finish{ambient 1}}
sphere{<n,sqrt(1-n*n) , 3>,0.01 pigment{rgb 1} finish{ambient 1}}
sphere{<n,(hiloer(n)) , 3>,0.01 pigment{rgb 1} finish{ambient 1}}
#declare n=n+0.001;
#end
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Greg M. Johnson <pte### [at] thecommononethatstartswithycom> wrote:
> I went and tried a #macro anyway, and it doesn't work.
It does if you write it right.
#macro hiloer(jay)
#if (jay<0.5)
#local result = (0+0.5*(1-sqrt(1-jay*jay*4));
#else
#local result = (0+jay);
#end
result
#end
Of course an alternative way of doing the same thing is:
#macro hiloer(jay)
((jay<0.5) ?(0+0.5*(1-sqrt(1-jay*jay*4)) : (0+jay)
#end
--
- Warp
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|