I'm trying to implement a simple softwared based 3d renderer.
So far I'm able to load and render .obj files exported from blender. To draw the faces of the model I use the love.graphics.polygon() function. This works as expected when using the fill option, however when using the line option to basically render the model in wireframe mode things start to look weird.
I've included a simple script to replicate the issue I'm having:
Code: Select all
function love.load()
x = 99
end
function love.draw()
love.graphics.setLineWidth(2)
love.graphics.rectangle("line",10,10,100,100)
love.graphics.polygon("line",x,20,100,10,100,110,x,90)
end
function love.update(dt)
end
function love.keypressed(k)
if k == "escape" then love.event.push("quit") end
if k == "right" then x = x + 1 end
if k == "left" then x = x - 1 end
print(x)
end
Has anybody a workaround for this?