|
![](/i/fill.gif) |
Warp <war### [at] tag povray org> wrote:
> > What's even better is that you can throw out the rgb reference if you use
> > vectors, i.e.:
> > 'pigment{color x}' = 'pigment{color rgb <1,0,0>}'
>
> Why not 'pigment{rgb x}'?
Even though this is valid, it gives me the creeps for some reason, x is x,
red is red...
>
> This is not just a "short code trick", it should be basic knowledge right
> from the documentation.
>
> > 3. Vector Substitution
>
> > A constant 'C' will be interpreted as '<C,C,C>' if the parser needs a
> > vector. This can be quite useful since '1-z' is equivalent to '<1,1,0>',
> > but with less than half the bytes.
>
> Again not even a "trick", but basic info straight from the documentation.
>
Not necessarily all tricks, but often ignored, skipped over or forgotten...
> > #macro a(b)#if(b<5)box{-1,1scale.5translate y-3pigment{color x}}#end#end
>
> That's not even the shortest way of doing that ;)
>
> --
> - Warp
Best I can do:
#macro a(b)#if(b<5)box{y-3.5y-2.5pigment{rgb x}}#end#end
-tgq
Post a reply to this message
|
![](/i/fill.gif) |