POV-Ray : Newsgroups : povray.general : Tips for Short Code Contest : Re: Tips for Short Code Contest Server Time
31 Jul 2024 18:25:58 EDT (-0400)
  Re: Tips for Short Code Contest  
From: Warp
Date: 12 Oct 2006 23:08:30
Message: <452f032d@news.povray.org>
Trevor G Quayle <Tin### [at] hotmailcom> wrote:
> >   Why not 'pigment{rgb x}'?

> Even though this is valid, it gives me the creeps for some reason, x is x,
> red is red...

  You are not a programmer then? ;)

  I think of 'x' as '<1, 0, 0>', not as "the x axis". Since '<1, 0, 0>' is
a valid and normal color (in a similar way as eg "#FF0000" is a valid normal
color in html), then 'x' is one too.

  This actually makes understanding things like "x+y" easier. You have
to think about that as "<1, 0, 0> + <0, 1, 0>", not as "the x axis plus
the y axis", which would be quite confusing.

> > > #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 ;)

> Best I can do:
> #macro a(b)#if(b<5)box{y-3.5y-2.5pigment{rgb x}}#end#end

  Much better. :P

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.