mirror of
https://github.com/Reuh/ubiquitousse.git
synced 2025-10-27 17:19:31 +00:00
Add gltf
This commit is contained in:
parent
5ee56f6aff
commit
77ece0b9a6
6 changed files with 519 additions and 2 deletions
23
gltf/gltf.can
Normal file
23
gltf/gltf.can
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
-- TODO: documentation
|
||||
|
||||
let loader = require((...):gsub("gltf$", "loader"))
|
||||
let draw = require((...):gsub("gltf$", "draw"))
|
||||
|
||||
-- glTF object methods
|
||||
let gltf_mt = {
|
||||
-- loaded glTF data; see loader.can for details on its structure
|
||||
gltf = nil,
|
||||
-- draw the glTF object; if shader is not given, will use the current shader
|
||||
-- see draw.can for the uniforms passed to the shader
|
||||
draw = :(shader)
|
||||
draw(@gltf, shader)
|
||||
end
|
||||
}
|
||||
gltf_mt.__index = gltf_mt
|
||||
|
||||
--- create new glTF object from a filepath
|
||||
return function(path)
|
||||
return setmetatable({
|
||||
gltf = loader(path)
|
||||
}, gltf_mt)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue