                      (Color.   64  192  64    32)
                      (Color.   64  192  64    64)])
 
-(def font (.deriveFont gui/cutive (float 20.0)))
-
-(def ^String message-fmt  "  %+5.2f    %+5.2f    %+5.2f")
-(def ^String message      "r        p        y      ")
-
 (def pitch-bounds (partial math/bound -0.5 0.5))
 (def yaw-bounds (partial math/bound -0.4 0.4))
 (def roll-bounds (partial math/bound -1.2 1.2))

(defn render [^Graphics2D g ^long w ^long h frame]
  (.setColor g background-color)
  (.fillRect g 0 0 w h)
  (let [[left-hand right-hand] frame
        fm         (.getFontMetrics g font)
        tw         (.stringWidth fm message)
        th         (.getHeight fm)
        td         (.getDescent fm)]
    (.setRenderingHint g RenderingHints/KEY_TEXT_ANTIALIASING RenderingHints/VALUE_TEXT_ANTIALIAS_ON)
    (.setRenderingHint g RenderingHints/KEY_ANTIALIASING RenderingHints/VALUE_ANTIALIAS_ON)
    (.setColor g hud-color)
    (.setFont g font)
    (.drawLine g (/ w 2 ) 0 (/ w 2) h)
    (.drawString g message (int (- (/ w 4) (/ tw 2))) (int (- h td)))
    (.drawString g message (int (- (* 3 (/ w 4)) (/ tw 2))) (int (- h td)))
    (.setColor g hud-lo-color)
    (doseq [x (map (fn [v] (int (* v (/ w 20.0)))) (range 20))]
      (.drawLine g x 0 x h))

     ~@body
     (.setTransform ~g t#)))

(defn draw-hand [^Graphics2D g w h {:keys [quality roll pitch yaw]} {:keys [norm lo]}]
  (when (pos? quality)
    (.setColor g (nth quality-colors (dec quality)))
    (doseq [n (range 5 (* 10 quality) 10)]
