|
![](/i/fill.gif) |
Wasn't it Veggiet who wrote:
>Hi,
> I'm not sure if this goes in the advanced category or not, but I'm having
>a problem. I trying to make a snow casting macro, and for this I using
>nested loops, but I don't want to have a blob created if a collision isn't
>made so here is the conext:
>
>[code]
>#declare trval = trace(Objapply, coords1, coords2, <0,0,0>);
>#if(trval != <0,0,0>)
>....
>#end
>[/code]
>
>It highlights the #if line and comes up with
>"Parse Error: Float expected but vector or color expression found."
>
>and If I change the expression to "(trval != 0)" It does the same thing.
Even if you get the syntax right, there's always the possibility of a
valid hit at the point <0,0,0>
The usual way to check for trace() hits is like this:
#declare Norm=<0,0,0>;
#declare trval = trace(Objapply, coords1, coords2, Norm);
#if (vlength(Norm) > 0)
...
#end
The normal will only have length zero if the trace misses.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
![](/i/fill.gif) |