POV-Ray : Newsgroups : povray.pov4.discussion.general : Scale Postfixes : Re: Scale Postfixes Server Time
2 Mar 2024 01:47:56 EST (-0500)
  Re: Scale Postfixes  
From: Reactor
Date: 3 Aug 2009 13:20:00
Message: <web.4a771be1fd0f4b0142e6f04b0@news.povray.org>
"clipka" <nomail@nomail> wrote:
> Wouldn't it be nice if the next generation SDL allowed for something like this:
>
>     sphere { Pos, 7.3 mm }
>
> or
>
>     box {
>         -<10in, 7ft, 3ft>, <10in, 7ft, 3ft>
>         rotate y * 1.7rad
>         translate <10yd+3ft, 3ft, 0>
>     }
>
> or
>
>     media { absorbtion 0.2/1m }
>
> or even
>
>     media { absorbtion 0.2/m }
>
> or
>
>     media { absorbtion 0.2m^-1 }
>
> ?

It isn't immediately clear to me why you couldn't implement units like that on
your own.  One of the thinks that makes pov powerful is the fact that you can.
Consider something like this:

#declare mm = 1;
#declare m = 1000 * mm;
#declare in = 25.4 * mm;
#declare ft = 12 * in;
#declare yd = 3 * ft;


    sphere { Pos, 7.3*mm }

    box {
        -<10*in, 7*ft, 3*ft>, <10*in, 7*ft, 3*ft>
        rotate y * 1.7*rad
        translate <10*yd+3*ft, 3*ft, 0>
    }

    media { absorbtion 0.2/(1*m) }

    media { absorbtion 0.2/m }

    media { absorbtion 0.2*m^-1 }

Since all of the units depend on the value for mm, if someone else had a scene
with a different scale, then you'd only need to change the size of mm in pov
units and the rest of your items would scale accordingly.

I do use real world units in some of my scenes because it can make things easier
to picture, but I don't see the need for a change, primarily since the syntax
above has the potential for ambiguity:

#declare MyVar = 1.5;
sphere{ Pos, 1.5ft }   // ok, fine
sphere{ Pos, MyVarft } // wait, the value of MyVar used in feet, or MyVarft?

If we use a space or operator to avoid ambiguity, we haven't really done much
differently from using the units as a variable and providing a conversion
factor.


-Reactor


Post a reply to this message

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