POV-Ray : Newsgroups : povray.general : deformed box : Re: deformed box Server Time
30 Jul 2024 22:14:08 EDT (-0400)
  Re: deformed box  
From: Nicolas Alvarez
Date: 31 Mar 2008 00:31:35
Message: <47f07737$1@news.povray.org>
Nicolas Alvarez escribió:
> RafaƂ Maj escribió:
>> Helpfull, but I need higher quality - to deform actual shape - so that 
>> the
>> border betwen "walls" will not appear so straight artificial etc
> 
> Deforming actual shape = isosurface.
> 
> I think it would be a lot faster to use 6 isosurface "planes" than an 
> actual box (intersection of planes in a single isosurface).

camera {
   location  <-20.0, 10.0, -10.0>
   direction 1.5*z
   look_at   <0.0, 9.0, 0.0>
}

light_source {
   <-10, 20, -15>
   color rgb 1
}

#declare Granite = function { pigment { granite scale 10 } };
union {
   isosurface {
     function { y-Granite(x,y,z).x*0.5 }
     contained_by {
       box {
         <-30, 0, -30>, <30, 1, 30>
       }
     }
     max_gradient 2.2
   }
   isosurface {
     function { z-Granite(x,y,-z).x*0.5 }
     contained_by {
       box {
         <-30, 0, 0>, <30, 30, 1>
       }
     }
     max_gradient 2.2
     scale <1,1,-1>
     translate z*30
   }
   isosurface {
     function { x-Granite(-x,y,z).x*0.5 }
     contained_by {
       box {
         <0, 0, -31>, <1, 30, 31>
       }
     }
     max_gradient 2.2
     scale <-1,1,1>
     translate x*30
   }
   pigment {
     color White
   }
}

Up to you to add the remaining three planes.


Post a reply to this message

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