- Download Lua5.1 and Assimp static libraries
- Change CMakeLists include and link directories to match your own
cmake .
With your Love2D game, you will need to include both Love2DAssimp.dll
and assimp.dll
from https://www.assimp.org/index.php/downloads.
local Love2DAssimp = require("Love2DAssimp")
local importedMeshList = Love2DAssimp.assimp_import("my_model.dae")
The format of importedMeshList
is:
{
[1] = {
{x, y, z, u, v},
{x, y, z, u, v},
...
},
[2] = {
{x, y, z, u, v},
...
}
}
You can import each mesh into a Love2D mesh with:
local format = {
{"VertexPosition", "float", 3},
{"VertexTexCoord", "float", 2},
}
local mymesh = love.graphics.newMesh(format, importedMeshList[1], "triangles")
Run love .
in the example
folder for a working example.
Model used in example: https://www.models-resource.com/mobile/summonerswar/model/9568/