POV-Ray : Newsgroups : povray.general : How to center an object by visibility? Server Time
28 Mar 2024 10:14:51 EDT (-0400)
  How to center an object by visibility? (Message 1 to 4 of 4)  
From: Kima
Subject: How to center an object by visibility?
Date: 3 Dec 2019 06:05:01
Message: <web.5de6405a4547c21fecc0fada0@news.povray.org>
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).


Post a reply to this message

From: Bald Eagle
Subject: Re: How to center an object by visibility?
Date: 3 Dec 2019 07:30:01
Message: <web.5de6542d5a7e05f54eec112d0@news.povray.org>
"Kima" <nomail@nomail> wrote:
> 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).

Well, the best I know of so far is to define a reference point and use that.

So do some math, define a center point, and then use a transform.

http://news.povray.org/povray.newusers/message/%3C56d3df45%241%40news.povray.org%3E/#%3C56d3df45%241%40news.povray.org%
3E

Aside from that, maybe use trace or the screen object placement macros that were
being fiddled with a while back

http://news.povray.org/povray.tools.general/thread/%3Cweb.5ba183edb47e1707a47873e10%40news.povray.org%3E/


Post a reply to this message

From: jr
Subject: Re: How to center an object by visibility?
Date: 3 Dec 2019 08:40:01
Message: <web.5de665505a7e05f5feeb22ff0@news.povray.org>
hi,

"Kima" <nomail@nomail> wrote:
> 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).

adjust the BB?

<http://news.povray.org/povray.text.scene-files/message/%3Cweb.5dc0bff634d8ef06feeb22ff0%40news.povray.org%3E/#%3Cweb.5
dc0bff634d8ef06feeb22ff0%40news.povray.org%3E>


regards, jr.


Post a reply to this message

From: Alain Martel
Subject: Re: How to center an object by visibility?
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.