POV-Ray : Newsgroups : povray.newusers : Re: How to transform box<0 , 1> to box<p1 , p2>? : Re: How to transform box<0 , 1> to box<p1 , p2>? Server Time
2 Nov 2024 05:22:51 EDT (-0400)
  Re: How to transform box<0 , 1> to box<p1 , p2>?  
From: D  H  Berlin
Date: 22 Aug 2004 07:55:00
Message: <web.4128883bbaeff42344ab2cfe0@news.povray.org>
#include "math.inc"
#macro dabox(p1,p2)
 box{0, 1 texture {boxhm}
     scale vlength(p2-p1)
     rotate vcross(1,p2)*VRotationD(1, p2, vcross(1,p2))
     translate p1
 }
#end


With textures:

#include "colors.inc"
#include "metals.inc"
#include "woods.inc"
#include "math.inc"
#declare box_holz = texture {T_Wood10 scale 1 rotate y*20 };
#declare box_metal = texture {T_Silver_3D};
#declare box_metal_ab = 0.85;
#declare boxhm =
    texture {
      function{sqrt(y*y+(1-z)*(1-z))}
      texture_map {
        [ 0.0 box_holz ]
        [ box_metal_ab box_holz ]
        [ box_metal_ab*1.0107 box_metal ]
        [ 1 box_metal ]
      }
    };
#macro dabox(p1,p2)
 box{0, 1 texture {boxhm}
     scale vlength(p2-p1)
     rotate vcross(p1,p2)*VRotationD(p1, p2, vcross(p1,p2))
     translate p1
 }
#end


Post a reply to this message

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