POV-Ray : Newsgroups : povray.general : shear matrix problem : Re: shear matrix problem Server Time
29 Jul 2024 12:16:45 EDT (-0400)
  Re: shear matrix problem  
From: Roman Reiner
Date: 14 Jul 2011 04:55:00
Message: <web.4e1eaeba7fd51405257ce790@news.povray.org>
Like this?

//Start Code
#local P1 = <-1.6, 0.1, 0>;
#local P2 = < 1.7, 1.5, 0>;

#local Point =
sphere {
   <0,0,0>, 0.05
   pigment { rgb 1 }
}

object {Point}
object {Point translate P1  pigment {rgb <1,0,0>}}
object {Point translate P2  pigment {rgb <1,1,0>}}

#local Segment =
box {<0.00, 0.00, -0.010>, <1.00, 0.10, 0.010>}

#declare d = P2-P1;

#local a = 0;
#local b = d.x;

union {
   #while (a < b)
     object {Segment
       translate <a, 0, 0>
       #if (mod(a,2)=0)
         pigment {rgb <0,1,0>}
       #else
         pigment {rgb <0,0,1>}
       #end
       #local a=a+1;
     }
   #end
   clipped_by {plane {x, b}}
   matrix <d.x/b,  d.y/b,  0, // matrix-shear_x_to_y
           0,  1,  0,
           0,  0,  1,
           0,  0,  0>
   translate P1
}
//End Code


Post a reply to this message

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