From b97f172e948872cfe1bf030f95ff50e5d0b2a1bc Mon Sep 17 00:00:00 2001 From: sanine-a Date: Mon, 23 Nov 2020 02:07:49 -0600 Subject: fix bug in mesh loading --- demo/main.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'demo/main.lua') diff --git a/demo/main.lua b/demo/main.lua index aa91acd..660614d 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -21,11 +21,17 @@ local sceneRoot = Node.new(nil, Vector.Vec3.new{1,1,1}) local shader = SpatialShader.new(tex) +local lightDirection = Vector.Vec3.new{1,1,1} +lightDirection:normalize() +shader:setVec3('directional_lights[0].direction', lightDirection) +shader:setVec3('directional_lights[0].color', Vector.Vec3.new{0,1,0}) +local meshes = honey.mesh.load('Suzanne.obj') +print(#meshes) local suzanne = MeshInstance.new(sceneRoot, Vector.Vec3.new{0,0,-3}, Vector.Vec3.new{0,math.pi,0}, Vector.Vec3.new{0.5,1,0.5}, - honey.mesh.load('Suzanne.obj')[1], + meshes[1], shader) local plane = MeshInstance.new(suzanne, Vector.Vec3.new{1,0,0}, @@ -41,8 +47,8 @@ local plane2 = MeshInstance.new(suzanne, shader) suzanne.update = function(self, dt) - local angle = dt * math.pi - self:yaw(angle) + --local angle = dt * math.pi + --self:yaw(angle) end local total_frames = 0 -- cgit v1.2.1