|
|
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
|
|
|
|
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
|
|