POV-Ray : Newsgroups : povray.windows : Object changes when translated, rotated, or camera position changes : Re: Object changes when translated, rotated, or camera position changes Server Time: 24 Sep 2020 21:03:23 GMT
  Re: Object changes when translated, rotated, or camera position changes  
From: Alain
Date: 3 Nov 2013 03:12:57
Le 13-11-01 12:38, Charles a écrit :
> 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-2008 Persistence of Vision Raytracer Pty. Ltd.