POV-Ray : Newsgroups : povray.general : deformed box Server Time
31 Jul 2024 02:25:01 EDT (-0400)
  deformed box (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Warp
Subject: Re: deformed box
Date: 31 Mar 2008 15:15:34
Message: <47f14666@news.povray.org>
Rafa? Maj <no.### [at] invalidcominvalid> wrote:
> So I was hoping for a solution that would operate on mesh

  You can create six heightfields from the same functions as the isosurface
and they may render even faster than a mesh.

-- 
                                                          - Warp


Post a reply to this message

From: Tim Attwood
Subject: Re: deformed box
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

<<< Previous 10 Messages Goto Initial 10 Messages

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