summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-11-09 19:59:52 -0500
committerDavid Thompson <dthompson2@worcester.edu>2015-11-09 19:59:52 -0500
commit6a2fe97bff4ded0fa6d43353d9c7cb61fda98d82 (patch)
treeaf7e9aa2aab2d0f660bc7479ca00d654f7127233
parent7d4fd17a18e12c0e5fbc8618378bacd488c2678e (diff)
render: Add more rotation combinators.
* sly/render.scm (rotate-x, rotate-y, rotate): New procedures.
-rw-r--r--sly/render.scm18
1 files changed, 18 insertions, 0 deletions
diff --git a/sly/render.scm b/sly/render.scm
index e69f756..47aa862 100644
--- a/sly/render.scm
+++ b/sly/render.scm
@@ -110,7 +110,10 @@
with-model-view-mul
move
scale
+ rotate-x
+ rotate-y
rotate-z
+ rotate
clear-screen
uniform-let
with-color
@@ -472,11 +475,26 @@ applies RENDERER."
RENDERER."
(with-model-view-mul (t:scale s) renderer))
+(define (rotate-x theta renderer)
+ "Create a new renderer that rotates the scene by THETA about the X
+axis and applies RENDERER."
+ (with-model-view-mul (t:rotate-x theta) renderer))
+
+(define (rotate-y theta renderer)
+ "Create a new renderer that rotates the scene by THETA about the Y
+axis and applies RENDERER."
+ (with-model-view-mul (t:rotate-y theta) renderer))
+
(define (rotate-z theta renderer)
"Create a new renderer that rotates the scene by THETA about the Z
axis and applies RENDERER."
(with-model-view-mul (t:rotate-z theta) renderer))
+(define (rotate quaternion renderer)
+ "Create a new renderer that rotates the scene by QUATERNION and
+applies RENDERER."
+ (with-model-view-mul (t:rotate quaternion) renderer))
+
(define (clear-screen gfx)
"Clear the current viewport bound to GFX."
(clear-viewport (graphics-viewport gfx)))