From dbe0aa50586ca9216e34c2258e8834d8121f3ae4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Mon, 18 Jan 2016 11:54:57 -0500 Subject: [PATCH] lib/gamnit depth: add texture_coords to Cube MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/gamnit/depth/more_meshes.nit | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/gamnit/depth/more_meshes.nit b/lib/gamnit/depth/more_meshes.nit index 1c6edf4..fe3f9df 100644 --- a/lib/gamnit/depth/more_meshes.nit +++ b/lib/gamnit/depth/more_meshes.nit @@ -101,5 +101,16 @@ class Cube return normals end + redef var texture_coords: Array[Float] is lazy do + var a = [0.0, 1.0] + var b = [1.0, 1.0] + var c = [0.0, 0.0] + var d = [1.0, 0.0] + + var texture_coords = new Array[Float] + for v in [c, d, a, a, d, b] do for i in 6.times do texture_coords.add_all v + return texture_coords + end + redef var center = new Point3d[Float](0.0, 0.0, 0.0) is lazy end -- 1.7.9.5