1.2.3-SNAPSHOT permalink Arrow_down_16x16

with-rotation

incanter.processing

  • (with-rotation sketch rotation & body)
Performs body with rotation, restores current transformation on exit.
Accepts a vector [angle] or [angle x-axis y-axis z-axis].

Example:
(with-rotation sktch angle
(vertex sktch 1 2))

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/processing.clj:1418 top

(defmacro with-rotation
        "Performs body with rotation, restores current transformation on exit.
  Accepts a vector [angle] or [angle x-axis y-axis z-axis].

  Example:
    (with-rotation sktch angle
      (vertex sktch 1 2))"
        ([^PApplet sketch rotation & body]
        `(let [tr# ~rotation
               sk# ~sketch]
                 (push-matrix sk#)
                 (apply rotate [sk# tr#])
                 ~@body
                 (pop-matrix sk#))))
Vars in incanter.processing/with-rotation: defmacro apply concat let list seq vector
Used in 0 other vars

Comments top

No comments for with-rotation. Log in to add a comment.