POV-Ray : Newsgroups : povray.general : example uses of min_extent() max_extent() : Re: example uses of min_extent() max_extent() Server Time
30 Jul 2024 18:18:36 EDT (-0400)
  Re: example uses of min_extent() max_extent()  
From: Mike Williams
Date: 12 Sep 2008 20:11:16
Message: <6jUlK1AcUwyIFwPI@econym.demon.co.uk>
Wasn't it wyleu who wrote:
>As always the posting of the question very qickly leads to an answer
>
>#declare Sphere =
>sphere {
>  <0,0,0>, 1
>  pigment { rgb <1,0,0> }
>}
>#declare Min = min_extent ( Sphere );
>#declare Max = max_extent ( Sphere );
>object { Sphere }
>box {
>    Min, Max
>    pigment { rgbf <1,1,1,0.5> }
>}
>
>
>
>However this is a bounding box of an object, can I extract the co-ordinates of
>the bounding box as it's projected onto the viewing plane so I can provide
>these as co-ordinates to a function like html ISMAP and USEMAP to allow
>hypertext like functions from web background pages?


Be aware that min_extent and max_extent doesn't always produce efficient 
bounds for an object if there's awkward CSG going on. POV will produce a 
slab that is guaranteed to contain the object, but there's no guarantee 
that it will fit snugly.

Consider this:

#declare Object = difference {
   sphere { <0,0,0>, 1}
   box {<-2,-2,-2><0.7,2,2>}
   pigment { rgb <1,0,0> }
}
#declare Min = min_extent ( Object );
#declare Max = max_extent ( Object );
object { Object }

box {
     Min, Max
     pigment { rgbf <1,1,1,0.5> }
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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