POV-Ray : Newsgroups : povray.general : deformed box : Re: deformed box Server Time
31 Jul 2024 04:26:40 EDT (-0400)
  Re: deformed box  
From: Tim Attwood
Date: 1 Apr 2008 03:25:53
Message: <47f1f191$1@news.povray.org>
> So I was hoping for a solution that would operate on mesh

// an object with 8 corners (clockwise front ABCD) (Clockwise rear EFGH)
#macro Free_Box(A B C D E F G H)
mesh {
   triangle {A,B,C} //front
   triangle {C,D A}
   triangle {A,E,H} //left
   triangle {A,D,H}
   triangle {B,F,G} //right
   triangle {B,C,G}
   triangle {A,E,F} //top
   triangle {A,B,F}
   triangle {C,G,H} //bottom
   triangle {C,D,H}
   triangle {E,F,G} //back
   triangle {G,H,E}
   inside_vector <(A.x+G.x)/2,(A.y+G.y)/2,(A.z+G.z)/2>
}
#end

You might want to move the inside vector outside the box
to invert it, and it's up to you to keep the walls flat.


Post a reply to this message

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