POV-Ray : Newsgroups : povray.general : Scaling macros? : Re: Scaling macros? Server Time
4 Aug 2024 04:17:57 EDT (-0400)
  Re: Scaling macros?  
From: Christopher James Huff
Date: 29 Jul 2003 13:41:45
Message: <cjameshuff-DE318D.12414529072003@netplex.aussie.org>
In article <3F26A95E.4D3834F1@hotmail.com>,
 John VanSickle <evi### [at] hotmailcom> wrote:

> Let's say I design a scene using centimeters.  You design a model using
> meters, or some English unit.
> 
> Who would find a set of relatively automatic scale converters
> useful?

What I do is just define cm, mm, m, km, etc at the beginning of the 
scene. Then I just do something like "15.7*m" when specifying a 
dimension. A macro version could also work, something like: "km(45)"

I do use lowercase identifiers here, but I don't think a collision is 
likely for these and it helps separate them from the rest of the code.


> union {
>   sphere { pHere,rSize }
>   // etc
> 
>   UseCentimeters()
> }

I think this is a bit harder to read, putting the units separate from 
the values, and it might slow things down by forcing transformations to 
be evaluated unnecessarily, especially in the case of CSG.


union {
  sphere { pHere*cm, rSize*cm }
  // etc
}

union {
  sphere { pHere, rSize scale cm}
  // etc
}

-- 
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.