POV-Ray : Newsgroups : povray.general : Scaling macros? : Re: Scaling macros? Server Time
4 Aug 2024 04:15:41 EDT (-0400)
  Re: Scaling macros?  
From: Christopher James Huff
Date: 29 Jul 2003 17:53:22
Message: <cjameshuff-BD125F.16532229072003@netplex.aussie.org>
In article <web.3f26e01d9c12b543a0c272b50@news.povray.org>,
 "gonzo" <rgo### [at] lansetcom> wrote:

> But this is something I have been wondering myself, how others deal with
> different scalings and unit sizes.  I've tried to keep all of mine together
> and right at the top of the file so if someone wanted to do their own
> conversion it shouldn't be too difficult.

You could also base them all off of one value:

#declare m = 1;
#declare cm = m/100;
#declare mm = m/1000;
#declare km = m*1000;
#declare in = m/0.0254;
#declare ft = in*12;
#declare yd = ft*3;
#declare mi = km/1.607347;

This way, you only have one constant to change...the number of units in 
a meter, in this case. If everyone uses the same unit names, all you 
have to do is change that value. (or just remove it and place it 
elsewhere, such as in a "units.inc" file)

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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