diff options
author | sanine-a <sanine.not@pm.me> | 2020-11-23 02:07:49 -0600 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-11-23 02:07:49 -0600 |
commit | b97f172e948872cfe1bf030f95ff50e5d0b2a1bc (patch) | |
tree | 4281b319ac62799253d1974a50e3015b3d11b25f /demo/main.lua | |
parent | 7bdeedd394e4b51d4c2ef4a0dd0470ed0492ac5f (diff) |
fix bug in mesh loading
Diffstat (limited to 'demo/main.lua')
-rw-r--r-- | demo/main.lua | 12 |
1 files changed, 9 insertions, 3 deletions
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 |