POV-Ray : Newsgroups : povray.windows : Object changes when translated, rotated, or camera position changes Server Time
23 Nov 2024 04:38:46 EST (-0500)
  Object changes when translated, rotated, or camera position changes (Message 1 to 3 of 3)  
From: Charles
Subject: Object changes when translated, rotated, or camera position changes
Date: 1 Nov 2013 12:40:01
Message: <web.5273d923f95de83f7e5d10980@news.povray.org>
I have an object bounded by a box. it works fine except when I try and move it
or change the camera angle and the bounding box looses it's affect.
Is this a bug?
 Code:

#declare Lowermouth = union{
torus{ 0.6, 0.2 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,0>}
torus{ 0.55, 0.19 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-0.25>}
torus{ 0.5, 0.18 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-0.5>}
torus{ 0.45, 0.165 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-0.75>}
torus{ 0.4, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1>}
torus{ 0.35, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1.25>scale
<1,0.99,1>}
torus{ 0.29, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1.5>scale
<1,0.98,1>}
torus{ 0.22, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1.75>scale
<1,0.96,1>}
torus{ 0.15, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-2>scale
<1,0.94,1>}
                          }
#declare Lowermouth1 = object { Lowermouth
   bounded_by {
      box {
         <-3, -0.3, -3>, <3, -3, 3>
          }
              }
                              }


Post a reply to this message

From: Le Forgeron
Subject: Re: Object changes when translated, rotated, or camera position changes
Date: 1 Nov 2013 15:28:41
Message: <527400e9@news.povray.org>
Le 01/11/2013 17:38, Charles nous fit lire :
> I have an object bounded by a box. it works fine except when I try and move it
> or change the camera angle and the bounding box looses it's affect.
> Is this a bug?
>  Code:
> 
> #declare Lowermouth = union{
> torus{ 0.6, 0.2 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,0>}
> torus{ 0.55, 0.19 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-0.25>}
> torus{ 0.5, 0.18 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-0.5>}
> torus{ 0.45, 0.165 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-0.75>}
> torus{ 0.4, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1>}
> torus{ 0.35, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1.25>scale
> <1,0.99,1>}
> torus{ 0.29, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1.5>scale
> <1,0.98,1>}
> torus{ 0.22, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1.75>scale
> <1,0.96,1>}
> torus{ 0.15, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-2>scale
> <1,0.94,1>}
>                           }
> #declare Lowermouth1 = object { Lowermouth
>    bounded_by {
>       box {
>          <-3, -0.3, -3>, <3, -3, 3>
>           }
>               }
>                               }
> 
> 

Bounded_by is no shortcut for proper intersection.

The Lowermouth is so far inside a box of <-0.800,-1.000,-2.150 >,
<0.800,0.600,0.200>

So your bounded_by box <-3,-0.3, -3>,<3,-3,3> is overlapping (hence
bogus). Garbage in... garbage out.

#declare fom=min_extent(Lowermouth1);
#declare fom2=max_extent(Lowermouth1);
#debug "Hello\n"
#debug concat(vstr(3,fom,",",0,3),"\n")
#debug concat(vstr(3,fom2,",",0,3),"\n")
#debug "World\n"


Post a reply to this message

From: Alain
Subject: Re: Object changes when translated, rotated, or camera position changes
Date: 2 Nov 2013 23:12:57
Message: <5275bf39$1@news.povray.org>

> I have an object bounded by a box. it works fine except when I try and move it
> or change the camera angle and the bounding box looses it's affect.
> Is this a bug?
>   Code:
>
> #declare Lowermouth = union{
> torus{ 0.6, 0.2 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,0>}
> torus{ 0.55, 0.19 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-0.25>}
> torus{ 0.5, 0.18 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-0.5>}
> torus{ 0.45, 0.165 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-0.75>}
> torus{ 0.4, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1>}
> torus{ 0.35, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1.25>scale
> <1,0.99,1>}
> torus{ 0.29, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1.5>scale
> <1,0.98,1>}
> torus{ 0.22, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-1.75>scale
> <1,0.96,1>}
> torus{ 0.15, 0.15 texture{Bodytex} rotate<90,0,0>translate <0,-0.2,-2>scale
> <1,0.94,1>}
>                            }
> #declare Lowermouth1 = object { Lowermouth
>     bounded_by {
>        box {
>           <-3, -0.3, -3>, <3, -3, 3>
>            }
>                }
>                                }
>
>

bounded_by is NO substitute to an intersection.
Missusing it that way will cause many problems:
Improper shadows.
Parts that are outside the bounding object are visible whenever the ray 
can encounter the bounding object. If a ray encounter the bounding 
object, it's content is tested for the entire path of that ray.

If you want to clip the object in a way that it's inside become visible, 
you can use clipped_by.

Use:
#declare Lowermouth1 = intersection{
   object { Lowermouth }
   box { <-3, -0.3, -3>, <3, -3, 3> }
}

OR
#declare Lowermouth1 = object { Lowermouth
    clipped_by {
       box {
          <-3, -0.3, -3>, <3, -3, 3>
           }
         }
     }



Alain


Post a reply to this message

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