|
|
Mike Williams nous apporta ses lumieres en ce 2007/11/13 15:01:
> Wasn't it Woody who wrote:
>> I'm trying to create two macros for use with Iso-surfaces
>> they are
>>
>> #macro mac_1()
>> #if(abs(x)+abs(y)<=0.05)
>> 0
>> #else
>> 1
>> #end
>> #end
>>
>> #macro mac_2(a,b,c)
>> abs(a)+abs(b)
>> #end
>>
>>
>> they are called from the isosurface as
>>
>> isosurface{
>> function{ mac_1() }
>>
>> }
>>
>> isosurface{
>> function { mac_2(x,y,z) }
>> }
>>
>> both produce 'float expected vector identifier found instead' errors.
>>
>> anybody got any ideas
>
> Macros are evaluated once, at parse time. Isosurface functions need to
> be evaluated for many possible x,y,z values at run time. So you have to
> rewrite your expressions as functions, not macros.
>
> The second one is easy to write:
> function { abs(x)+abs(y) }
>
> The problem is that the expression is >=0 everywhere. It's only zero
> along an infinitely thin line along the z axis, and you see nothing.
It's only a problem if your treshold is zero. If you increase the treshold, it
gets whider and whider.
>
>
--
Alain
-------------------------------------------------
I find that the harder I work, the more luck I seem to have.
Thomas Jefferson
Post a reply to this message
|
|