POV-Ray : Newsgroups : povray.general : While we are talking about changes : Re: While we are talking about changes Server Time
10 Aug 2024 11:20:32 EDT (-0400)
  Re: While we are talking about changes  
From: Chris Huff
Date: 14 Mar 2000 19:22:20
Message: <chrishuff_99-1EC352.19241414032000@news.povray.org>
In article 
<Pin### [at] belialrenonvus>, 
<cre### [at] belialrenonvus> wrote:

> Good!:) btw since we're kinda on the subject, how can I shorten the 
> box {<-0.5,-0.5,-0.5>,<0.5,0.5,0.5> } 
> 
> see I always make my boxes that big then scale the suckers to 
> whatever I'm doing, the thing is typing all those 0.5's can be tiring 
> (I get around that with cut and paste, but still if there is some 
> shortform...I'd love to know it :)

You could use this:
#declare Box = box {<-0.5,-0.5,-0.5>,<0.5,0.5,0.5> }

And then make your boxes with
object {Box
...
}

Or you can leave the 0's out:
box {<-.5,-.5,-.5>,<.5,.5,.5> }
And to shorten it further, you can use the feature of POV that promotes 
floats to vectors when necessary:
box {-0.5, 0.5}
or
box {-.5,.5}

This isn't as easy to immediately understand, though, and is just as 
long as using a Box variable.


If you really want to eliminate keypresses, try this:
#macro Box()
box {<-.5,-.5,-.5>,<.5,.5,.5>
#end

You would use the macro this way:

Box()
...object stuff, textures, etc go here...
}

You could use a shorter name for the macro, but you can't eliminate the 
parentheses.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

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