From 7102f659a9eae83493c295f7ea2cb857ac7e3c3c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Mon, 1 Feb 2016 14:35:52 -0500 Subject: [PATCH] lib/gamnit flat: rotation follows the right hand rule on the Z axis MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/gamnit/flat.nit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gamnit/flat.nit b/lib/gamnit/flat.nit index b489f1c..b74da82 100644 --- a/lib/gamnit/flat.nit +++ b/lib/gamnit/flat.nit @@ -52,7 +52,7 @@ class Sprite # Position of this sprite in world coordinates var center: Point3d[Float] is writable - # Rotation on the Z axis + # Rotation on the Z axis, where 0.0 points right and `0.5*pi` points up var rotation = 0.0 is writable # Mirror `texture` horizontally, inverting each pixel on the X axis @@ -95,7 +95,7 @@ class Sprite else texture.texture_coords, 2) simple_2d_program.coord.array(texture.vertices, 3) - simple_2d_program.rotation.uniform new Matrix.rotation(rotation, 0.0, 0.0, 1.0) + simple_2d_program.rotation.uniform new Matrix.rotation(rotation, 0.0, 0.0, -1.0) glDrawArrays(gl_TRIANGLE_STRIP, 0, 4) end -- 1.7.9.5