POV-Ray : Newsgroups : povray.general : Feature Request Server Time
1 Nov 2024 05:21:12 EDT (-0400)
  Feature Request (Message 1 to 4 of 4)  
From: Andrea Ryan
Subject: Feature Request
Date: 7 Nov 1999 19:50:55
Message: <38261CEA.4E539B3C@global2000.net>
Should a shear keyword be added to POV-Ray? Are there any other
transformations that can be performed only by using the matrix keyword?
Brendan Ryan


Post a reply to this message

From: TonyB
Subject: Re: Feature Request
Date: 7 Nov 1999 21:59:22
Message: <38263c8a@news.povray.org>
It's easier to work with a macro. No need to add another keyword for that.
Besides, if it were to be added, I think "skew" would sound better.


Post a reply to this message

From: Nieminen Juha
Subject: Re: Feature Request
Date: 8 Nov 1999 05:19:26
Message: <3826a3ae@news.povray.org>
Andrea Ryan <ary### [at] global2000net> wrote:
: Should a shear keyword be added to POV-Ray? Are there any other
: transformations that can be performed only by using the matrix keyword?

  Actually you can shear an object without the matrix transformation, using
scales and rotates, but you need some math to get it exactly the way you
want.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Philippe Debar
Subject: Re: Feature Request
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.