POV-Ray : Newsgroups : povray.general : looking for a box macro : Re: looking for a box macro Server Time
7 Aug 2024 21:20:46 EDT (-0400)
  Re: looking for a box macro  
From: Warp
Date: 3 Jun 2001 16:36:24
Message: <3b1a9fc8@news.povray.org>
#macro Box(Point1, Point2, Width, Height, Rotation)
  #local Len = vlength(Point2-Point1);
  #local Dir = vnormalize(Point2-Point1);
  box
  { <-Width/2, 0, -Height/2>, <Width/2, Len, Height/2>
    rotate y*Rotation
    #local VY=vcross(Dir,y);
    #if(vlength(VY)>0)
      #local VY=vnormalize(VY);
      #local VZ1=vcross(VY,y);
      #local VZ2=vcross(VY,Dir);
      matrix <     0, VY.x, VZ1.x,
                   1, VY.y, VZ1.y,
                   0, VY.z, VZ1.z,
                   0,    0,     0 >
      matrix < Dir.x, Dir.y, Dir.z,
                VY.x,  VY.y,  VY.z,
               VZ2.x, VZ2.y, VZ2.z,
                   0,     0,     0 >
    #end
    translate Point1
  }
#end


-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

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