"homogenous" is what your brain feels like after figuring this out. :^)
Here's one that I devised.
Usage: (setq RotMtx (RotMat 0.0 pi 0.0)) ;get rotation matrix.
(setq p1 (cdr (assoc 10 nen)) ;get point to rotate.
p1 (trans p1 0 2)
p1 (mxv RotMtx p1)
p1 (vl-remove (last p1) p1) ;new point.
)
[code]
;;8/26/05 Revised to columns
;;Usage - Input x,y,z rotation angles, creates rotation matrix.
;;
;;angx, angy, angz are angle around each, x = pitch, axis = y = roll, z = yaw.
;;
(defun RotMat (angx angy angz / Rot_Matrix)
(setq Rot_Matrix (list
(list (+ (* (cos angz)(cos angy))(* (sin angz)(sin angx)(sin angy)))
(* (sin angz)(cos angx))
(+ (* (sin angz)(sin angx)(cos angy))(* (cos angz)(- (sin angy))))
0.0)
(list (+ (* (- (sin angz))(cos angy))(* (cos angz)(sin angx)(sin angy)))
(* (cos angz)(cos angx))
(+ (* (cos angz)(sin angx)(cos angy))(* (sin angz)(sin angy)))
0.0)
(list (* (cos angx)(sin angy))
(- (sin angx))
(* (cos angx)(cos angy))
0.0)
(list 0.0 0.0 0.0 1.0)) ;perspective row.
) ;end setq
Rot_Matrix
)[/code]
Seems to work for my app. so that's when my research ended.
;----------------------------------------------;
;Vladimir Nesterovsky - Matrix function
(defun mxv (m v) ;NewP = Matrix * Point
(mapcar '(lambda (row) (dotprod row v)) m)
)
;---;
;Vladimir Nesterovsky - Matrix function
(defun dotprod (u v)
(apply '+ (mapcar '* u v))
)
;---------------------------------------------;
Bill
Message was edited by: BillZ