POV-Ray : Newsgroups : povray.general : Feature Request : Re: Feature Request Server Time
10 Aug 2024 21:07:50 EDT (-0400)
  Re: Feature Request  
From: Philippe Debar
Date: 9 Nov 1999 04:27:08
Message: <3827e8ec@news.povray.org>
Andrea Ryan <ary### [at] global2000net> wrote in message
news:38261CEA.4E539B3C@global2000.net...
> Should a shear keyword be added to POV-Ray?

You can try theses simple macros:

// ************************************************************************
//
//    SHEARING MACROS with simple degrees trig macros
//
// ************************************************************************
//
// I find these (simple) macros really usefull ; I use them very often
//
// Philippe Debar
//

// #version 3.1 ;



// Tired of degrees/radians conversions? try these!

#macro sind(A)
  (sin(radians(A)))
#end

#macro cosd(A)
  (cos(radians(A)))
#end

#macro tand(A)
  (tan(radians(A)))
#end

#macro asind(A)
  (degrees(asin(A)))
#end

#macro acosd(A)
  (degrees(acos(A)))
#end

#macro atan2d(A,B)
  (degrees(atan2(A,B)))
#end



// Shear an object
// Use like any other transformation
// Choose an axis to shear towards the others by an angle (in degrees)

#macro shearX(toYangle, toZangle)
  matrix < 1, tand(toYangle), tand(toZangle)
           0, 1, 0,
           0, 0, 1,
           0, 0, 0 >
#end

#macro shearY(toXangle, toZangle)
  matrix < 1, 0, 0,
           tand(toXangle), 1, tand(toZangle)
           0, 0, 1,
           0, 0, 0 >
#end

#macro shearZ(toXangle, toYangle)
  matrix < 1, 0, 0,
           0, 1, 0,
           tand(toXangle), tand(toYangle), 1,
           0, 0, 0 >
#end

// eof


Post a reply to this message

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