From 88d3b0cc3e739c118c8738295f55e735bea50e42 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 15 May 2014 22:18:00 -0400 Subject: Add make-transform*. * 2d/transform.scm (make-transform*): New procedure. --- 2d/transform.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to '2d') diff --git a/2d/transform.scm b/2d/transform.scm index e7b5c31..ea3061d 100644 --- a/2d/transform.scm +++ b/2d/transform.scm @@ -27,6 +27,7 @@ #:use-module (srfi srfi-42) #:use-module (2d vector2) #:export (make-transform + make-transform* null-transform identity-transform transform? @@ -74,6 +75,15 @@ column-major format." (array-set! matrix dd 3 3) (%make-transform matrix))) +(define* (make-transform* #:optional #:key (translate null-vector2) + (scale (vector2 1 1)) (rotate 0)) + "Return a new transform that is the result of the composition of the +given TRANSLATE, SCALE, and ROTATE values. Both TRANSLATE and SCALE +are vector2 values, while ROTATE is a number." + (transform* (transform-scale scale) + (transform-rotate rotate) + (transform-translate translate))) + (define null-transform (%make-transform (make-4x4-matrix))) -- cgit v1.2.3