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))
(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#))))
Comments top
No comments for with-rotation. Log in to add a comment.