1
0
Fork 0
mirror of https://github.com/Reuh/wirefame.git synced 2025-10-27 17:49:31 +00:00
This commit is contained in:
Étienne Fildadut 2021-02-18 17:22:21 +01:00
parent b4798c8c16
commit 77cfbaad52
24 changed files with 3033 additions and 1545 deletions

View file

@ -1,3 +1,4 @@
require("candran").setup()
local wirefame = require("wirefame")
love.graphics.setLineStyle("rough")
@ -6,23 +7,22 @@ love.window.setMode(1000, 1000, { vsync = false })
wirefame.defaultColor = { 1, 0, 0, 1 }
local camera = { 0, 1, 3 }
local frame = wirefame.model("frame.obj")
local model = wirefame.model("test/Duck.gltf")
:setColor(1, 1, 1)
local model = wirefame.model("metaknight.obj")
:scale(1/15, 1/15, 1/15)
:translate(0, -0.7, 0)
local img = wirefame.model(love.graphics.newImage("hyke.png")):scale{1/100, 1/100, 1/100}
-- local model = wirefame.model("test/metaknight.obj")
-- :scale{1/15, 1/15, 1/15}
-- :translate{0, -0.7, 0}
local scene = wirefame.scene()
:setViewport(0, 0, 1000, 1000)
:lookAt(camera, {0,0,0}, {0,1,0})
:setViewDistance(5)
:add(frame, model)
:setPerspective(math.rad(60), 1, .1, 100)
:lookAt({0,0,3}, {0,0,0}, {0,1,0})
:add(model, img)
function love.update(dt)
model:rotate(dt/2, {0, 1, 0})
scene:rotate(dt/2, {0, 1, 0})
end
function love.draw()