POV-Ray : Newsgroups : povray.general : Difference object that cant be scaled : Re: Difference object that cant be scaled Server Time
2 Nov 2024 07:24:58 EDT (-0400)
  Re: Difference object that cant be scaled  
From: Ger
Date: 26 Apr 2004 07:33:59
Message: <408cf3a7@news.povray.org>
lars petter wrote:

> Hi. I've got this difference object:
> 
> difference {   // a cylinder subtracted with another cylinder with smaller
> radius -> a ring
> 
>         cylinder {
>           <5, 0, 5>,
>           <5, 1, 5>,
>           1
>           pigment { rgb <1, 0, 0> }
>         }
> 
>        cylinder {
>           <5, 0, 5>,
>           <5, 1, 5>,
>           0.9
>           open
>        }
>     //scale <2,1,1>   is this the right place to insert the scaling?
> 
> }
> 
> if i try to scale it in x- or z- direction, the object simply fails to
> show in the render. scaling i y-direction however, works fine.
> 
> why is this?
> 
Because your scaling scales the position of the cylinder. It's still there
but has moved to <10,0,5> (Scaled x by 2)
Better would be to define your object at the origin <0,0,0> and then
translate it to where you want it to be.
So
difference {
    cylinder { <0, 0, 0>, <0, 1, 0>, 1 }
// Make the inner cylinder longer then the outer one to avoid
// accidental surfaces
    cylinder { <0,-1, 0>, <0, 2, 0>, 0.9 }
// Move the pigment out of the cylinder definition so they both use it
    pigment { rgb <1, 0, 0> }
// Here you apply scaling
    scale < 2, 1, 1 >
// Last you apply translation
    translate < 5, 0, 5 >
    //scale <2,1,1>   is this the right place to insert the scaling? Nope :)
}



-- 
Ger


Post a reply to this message

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