|
![](/i/fill.gif) |
Andrea Ryan <ary### [at] global2000 net> 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
|
![](/i/fill.gif) |