From 13b18b33261391ff5f7748336ec0db9e83e03309 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 23 Oct 2014 19:45:07 -0400 Subject: transform: Add build-transform procedure. * sly/transform.scm (build-transform): New procedure. --- sly/transform.scm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sly/transform.scm b/sly/transform.scm index 205ecbe..252c123 100644 --- a/sly/transform.scm +++ b/sly/transform.scm @@ -34,6 +34,7 @@ transpose transform-vector2 transform+ transform* scale translate rotate-x rotate-y rotate-z rotate + build-transform orthographic-projection perspective-projection look-at)) @@ -202,6 +203,14 @@ identity-transform if called without any arguments." (- 1 (* 2 (square x)) (* 2 (square y))) 0 0 0 0 1)))) +(define build-transform + (let ((%scale scale)) + (lambda* (#:optional #:key (position (vector3 0 0 0)) + (scale 1) (rotation null-quaternion)) + (transform* (translate position) + (%scale scale) + (rotate rotation))))) + (define (orthographic-projection left right top bottom near far) "Return a new transform that represents an orthographic projection for the vertical clipping plane LEFT and RIGHT, the horizontal -- cgit v1.2.3