From 6d96b0e7ea1d98e44647d0bbbba232701a7d557e Mon Sep 17 00:00:00 2001 From: sanine Date: Tue, 4 Oct 2022 14:53:08 -0500 Subject: add first person demo --- demo/bouncing_ball/main.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'demo/bouncing_ball') diff --git a/demo/bouncing_ball/main.lua b/demo/bouncing_ball/main.lua index f98a032..8315bb1 100644 --- a/demo/bouncing_ball/main.lua +++ b/demo/bouncing_ball/main.lua @@ -20,9 +20,13 @@ window.makeContextCurrent(w) gl.InitGlad() gl.Enable(gl.DEPTH_TEST) + +local projection = honey.glm.mat4() +honey.glm.perspective(math.rad(45), 800/600, 0.1, 1000, projection) window.setFramebufferSizeCallback(w, function(_, width, height) print(string.format("resize: (%d, %d)", width, height)) - gl.setViewport(0, 0, width, height) + gl.Viewport(0, 0, width, height) + honey.glm.perspective(math.rad(45), width/height, 0.1, 1000, projection) end) @@ -84,8 +88,6 @@ local translation = honey.glm.vec3() setVector(translation, 0, -1, -6) honey.glm.translate(view, translation) -local projection = honey.glm.mat4() -honey.glm.perspective(math.rad(45), 800/600, 0.1, 1000, projection) --====== main loop ======-- -- cgit v1.2.1