POV-Ray : Newsgroups : povray.newusers : Uneven Scaling on the Y-Axis : Re: Uneven Scaling on the Y-Axis Server Time
29 Jul 2024 16:19:17 EDT (-0400)
  Re: Uneven Scaling on the Y-Axis  
From: Christoph Hormann
Date: 30 Jul 2005 23:20:02
Message: <dcgqbm$96h$1@chho.imagico.de>
Mike Williams wrote:
> 
> It is, however, quite easy in POV to perform non-linear transformations
> on isosurfaces. The original poster wants to perform the non-linear
> transformation on a sphere, so there's no problem creating an isosurface
> to apply the non-linear transformation to.
> 
> 
> #declare  Sphere = function {x*x + y*y + z*z - 1}
> 
> isosurface {
>   function { Sphere(x,y*(2.5-y*0.8),z) }
>   max_gradient 4
>   contained_by{sphere{0,1}}
>   pigment {rgb 1}
> }
> 
> Adjust the "2.5" to change the overall vertical scale.
> Adjust the "0.8" to change how much the top differs from the bottom.
> 

Although it will be quite a bit faster if you use the internal function 
f_sphere().  Using a minimum size box container could also be more 
efficient.

:-)

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 24 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

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