POV-Ray : Newsgroups : povray.newusers : Prisms with conic sweeps and unpredictable results : Re: Prisms with conic sweeps and unpredictable results Server Time
4 Nov 2024 19:17:46 EST (-0500)
  Re: Prisms with conic sweeps and unpredictable results  
From: Mike Williams
Date: 28 May 2003 14:06:52
Message: <XZ6Z4EABqP1+EwaS@econym.demon.co.uk>
Wasn't it LibraryMan who wrote:
>I guess I'm just having difficulty understanding how to achieve predictable
>results with a conically swept prism object in my scene.  I specifically
>want the object to have the "ziggurat" type flattened top.  Given such a
>prism declaration, (lifted almost wholecloth out of the docs)
>  prism {
>    conic_sweep
>    linear_spline
>    0.85, // height 1
>    1, // height 2
>    5, // the number of points making up the shape...
>    <4,4>,<-4,4>,<-4,-4>,<4,-4>,<4,4>,
>    rotate <180, 0, 0>  //(yes, I get this part)
>    translate <0, X?, 0>
>    scale <1, 4, 1>
>    pigment { gradient y scale .2 }
>  }
>
>How much should the object get translated downward for its base to be at
>y=0? And would scaling the object along y affect where its base lay?

If you can't work it out, yo could try using trace() to find the
position of the base and then translating it by that amount in the
opposite direction.

#declare Thing =
  prism {
    conic_sweep
    linear_spline
    0.85, // height 1
    1, // height 2
    5, // the number of points making up the shape...
    <4,4>,<-4,4>,<-4,-4>,<4,-4>,<4,4>
    rotate <180, 0, 0>  //(yes, I get this part)
    scale <1, 4, 1>
    pigment { gradient y scale .2 }
  }
  
object {Thing translate -trace (Thing, <0,-100,0>, <0,1,0>)}


In this case, the distance to translate downwards is equal to the Y
coefficient of the scale. So for a scaling of <1,4,1> you translate by
<0,-4,0>.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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