Les fonctions: GET-ORTHO.LSP

;************************************************************************
;* [CMFAO] AME 6602 ACQUISITION DES DONNÉES SPATIALES                   *
;* [GRCAO] Claude Parisel                                               *
;* Mars 1999                                                            *
;************************************************************************
; GET-ORTHO
; Saisie d'une projection orthogonale sur XOY, YOZ ou ZOX
; et calcul de la matrice de projection
;------------------------------------------------------------------------
; rep       réponse
; choix     Choix de l'usager
; r1        indice de fin de boucle
;------------------------------------------------------------------------
; RETOUR:
; MATTRANS      Matrice de transformation
;------------------------------------------------------------------------
(defun get-ortho ( / rep choix r1)
  (setq r1 1)
  (print "Donnez le plan de projection: ")
  (while
    (= r1 1)
    (setq choix "XY")
    (setq rep (strcase (getstring "\n  XY/YZ/ZX/F <XY>: ")))
    (if (/= rep nil)(setq choix rep))
    (cond
      (
        (or (= choix "XY")(= choix "YX"))
        (setq mattrans (mat-xy))
        (setq r1 0)
      )
      (
        (or (= choix "YZ")(= choix "ZY"))
        (setq mattrans (mat-yz))
        (setq r1 0)
      )
      (
        (or (= choix "ZX")(= choix "XZ"))
        (setq mattrans (mat-zx))
        (setq r1 0)
      )
      (
        (= choix "F")
        (setq r1 0)
      )
    )
  )
  ;-----------------------
  ;Retour
  mattrans
)
;---------------------------------------------------------------------------
; Exemple:
; Command: (get-ortho)
;          "Donnez le plan de projection: "
;           XY/YZ/ZX/F <XY>:
xy
;           ((1.0 0.0 0.0 0.0) (0.0 1.0 0.0 0.0) (0.0 0.0 0.0 0.0) (0.0 0.0 0.0 1.0))
;---------------------------------------------------------------------------