POV-Ray : Newsgroups : povray.advanced-users : About mm_per_unit Server Time
23 Nov 2024 15:47:38 EST (-0500)
  About mm_per_unit (Message 1 to 2 of 2)  
From: Alain
Subject: About mm_per_unit
Date: 9 Dec 2015 15:09:55
Message: <56688a93$1@news.povray.org>
Presently, you can't use mm_per_unit in a scene.
You can't use it in a #declare as follow:
#declare Dimention = Something * mm_per_unit;
or in a scale statement.

It would be nice if it could be made accessible as a builtin constant 
like pi.

That could be usefull to create objects that can auto scale according to 
the scale of the scene.
The author of the scene would only need to set that value in the 
global_settings, and an imported object could scale itself, adjusting a 
fade_distance or media density accordingly.



Alain


Post a reply to this message

From: clipka
Subject: Re: About mm_per_unit
Date: 9 Dec 2015 18:46:43
Message: <5668bd63$1@news.povray.org>
Am 09.12.2015 um 21:10 schrieb Alain:
> Presently, you can't use mm_per_unit in a scene.
> You can't use it in a #declare as follow:
> #declare Dimention = Something * mm_per_unit;
> or in a scale statement.

I guess what you want would be

    #declare Dimension = Something / mm_per_unit;

> It would be nice if it could be made accessible as a builtin constant
> like pi.
> 
> That could be usefull to create objects that can auto scale according to
> the scale of the scene.
> The author of the scene would only need to set that value in the
> global_settings, and an imported object could scale itself, adjusting a
> fade_distance or media density accordingly.

Why not simply declare a suitable variable yourself, and use it like this:

    #declare mm = 10; // one millimeter in POV-Ray units
    global_settings {
      mm_per_unit 1/mm
    }
    ...
    #declare Dimension = Something * mm;


Post a reply to this message

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