3dreamengine / 3DreamEngine

3DreamEngine is an *awesome* 3d engine for LÖVE.
MIT License
388 stars 17 forks source link
2d 3 3d 3dengine 3dreamengine dream engine love love2d

3DreamEngine Discord server

Features

screenshots

Development

Due to rapid changes to 3Dream I am sometimes working on a separate beta branch.

Documentation

Undocumented features are subject to change. They will receive a proper documentation once finished.

Documentation hosted on GitHub

Emmy-love-api recommended for proper EmmyLua support.

How to use?

--load 3DreamEngine
local dream = require("3DreamEngine")

--optionally set settings
dream:setBloom(3)

--init (applies settings)
dream:init()

--loads a object
local yourObject = dream:loadObject("examples/monkey/object")

--creates a light
local light = dream:newLight("point", dream.vec3(3, 2, 1), dream.vec3(1.0, 0.75, 0.2), 50.0)

--add shadow to light source
light:addNewShadow()

function love.draw()
    --prepare for rendering
    dream:prepare()

    --add light
    dream:addLight(light)

    --rotate, offset and draw
    yourObject:resetTransform()
    yourObject:rotateY(love.timer.getTime())
    yourObject:translate(0, 0, -3)
    dream:draw(yourObject)

    --render
    dream:present()
end

function love.update()
    --update resource loader
    dream:update()
end

Examples

We have examples in the examples folder. The provided main.lua contains a demo selection screen.

Credits

License (MIT/EXPAT LICENSE)

Copyright 2020 Luke100000 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.