POV-Ray : Newsgroups : povray.general : How to center an object by visibility? : Re: How to center an object by visibility? Server Time
16 Apr 2024 05:08:30 EDT (-0400)
  Re: How to center an object by visibility?  
From: Alain Martel
Date: 3 Dec 2019 11:31:27
Message: <5de68ddf$1@news.povray.org>
Le 2019-12-03 à 06:00, Kima a écrit :
> Consider an object as
> 
> #declare obj = union {
> cylinder{ <-1,-1,-1>,<1,1,1>,.1
> cylinder{ <-1.5,-1.5,-1.5>,<1,1,1>,.1
> }
> 
> I can center the object by its bounding box using max_extent and min_extent.
> Evidently, the bounding box is centered not the visible object.
> 
> In this case, the right side is empty because there's nothing in the bounding
> (the cylinder side is at z=1, the farthest point).
> 
> 
That's a badly defined object. It must be :

#declare obj = union {
cylinder{ <-1,-1,-1>,<1,1,1>,.1}
cylinder{ <-1.5,-1.5,-1.5>,<1,1,1>,.1}
}


It's obvious that the lower right part is empty because the bounding 
box's faces are always parallel to the reference planes.
This don't change the fact that the bounding box for that object is as 
small as it can be.

What you seems to want is a bounding box that is rotated to match the 
length of that object. That would reduce the efficiency of the bounding 
mechanism.


Post a reply to this message

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