Skip to content

Commit

Permalink
rewrite/variant
Browse files Browse the repository at this point in the history
  • Loading branch information
arkenidar committed Jul 26, 2023
1 parent 9bbb19f commit 8afd58e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions opengl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ function draw_model(model)
-- glNormal3f, glVertex3f
for _,triangle in ipairs(model) do
local function normal(xyz) glNormal3f(xyz.x, xyz.y, xyz.z) end
local function vertex(xyz) normal(xyz.normal); glVertex3f(xyz.x, xyz.y, xyz.z) end
vertex(triangle[1])
vertex(triangle[2])
vertex(triangle[3])
local function vertex(xyz) glVertex3f(xyz.x, xyz.y, xyz.z) end
local function vertex_and_normal(xyz) normal(xyz.normal); vertex(xyz) end
vertex_and_normal(triangle[1])
vertex_and_normal(triangle[2])
vertex_and_normal(triangle[3])
end

glEnd()
Expand Down

0 comments on commit 8afd58e

Please sign in to comment.