Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions games/devtest/mods/gltf/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ The glTF test models (and corresponding textures) in this mod are all licensed f
* Minimal triangle, triangle without indices (`gltf_minimal_triangle.gltf`, `gltf_triangle_without_indices.gltf`)
* From [the glTF sample model collection](https://github.com/KhronosGroup/glTF-Sample-Models)
* Licensed under CC0 / public domain

<!-- TODO detail -->
Morph stuff is from https://github.com/KhronosGroup/glTF-Sample-Assets/
35 changes: 35 additions & 0 deletions games/devtest/mods/gltf/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,41 @@ end

register_entity("snow_man", {"gltf_snow_man.png"})
register_entity("spider", {"gltf_spider.png"})
core.register_entity("gltf:morph", {
initial_properties = {
visual = "mesh",
mesh = "gltf_morph_static.glb",
textures = {"gltf_morph_static.jpg"},
backface_culling = false,
visual_size = vector.new(5, 5, 5),
},
})

core.register_entity("gltf:morph_animated", {
initial_properties = {
visual = "mesh",
mesh = "gltf_morph_animated.glb",
textures = {},
backface_culling = false,
visual_size = vector.new(100, 100, 100),
},
on_activate = function(self)
self.object:set_animation({x = 0, y = 5}, 1)
end
})

core.register_entity("gltf:morph_animated2", {
initial_properties = {
visual = "mesh",
mesh = "gltf_morph_animated2.gltf",
textures = {},
backface_culling = false,
visual_size = vector.new(1, 1, 1),
},
on_activate = function(self)
self.object:set_animation({x = 0, y = 5}, 1)
end
})

core.register_entity("gltf:spider_animated", {
initial_properties = {
Expand Down
Binary file not shown.
192 changes: 192 additions & 0 deletions games/devtest/mods/gltf/models/gltf_morph_animated2.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
{
"scene" : 0,
"scenes":[
{
"nodes":[
0
]
}
],
"nodes":[
{
"mesh":0
}
],
"meshes":[
{
"primitives":[
{
"attributes":{
"POSITION":1
},
"targets":[
{
"POSITION":2
},
{
"POSITION":3
}
],
"indices":0
}
],
"weights":[
0.5,
0.5
]
}
],

"animations":[
{
"samplers":[
{
"input":4,
"interpolation":"LINEAR",
"output":5
}
],
"channels":[
{
"sampler":0,
"target":{
"node":0,
"path":"weights"
}
}
]
}
],

"buffers":[
{
"uri":"data:application/gltf-buffer;base64,AAABAAIAAAAAAAAAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAAA/AAAAPwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIC/AACAPwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIA/AACAPwAAAAA=",
"byteLength":116
},
{
"uri":"data:application/gltf-buffer;base64,AAAAAAAAgD8AAABAAABAQAAAgEAAAAAAAAAAAAAAAAAAAIA/AACAPwAAgD8AAIA/AAAAAAAAAAAAAAAA",
"byteLength":60
}
],
"bufferViews":[
{
"buffer":0,
"byteOffset":0,
"byteLength":6,
"target":34963
},
{
"buffer":0,
"byteOffset":8,
"byteLength":108,
"byteStride":12,
"target":34962
},
{
"buffer":1,
"byteOffset":0,
"byteLength":20
},
{
"buffer":1,
"byteOffset":20,
"byteLength":40
}
],
"accessors":[
{
"bufferView":0,
"byteOffset":0,
"componentType":5123,
"count":3,
"type":"SCALAR",
"max":[
2
],
"min":[
0
]
},
{
"bufferView":1,
"byteOffset":0,
"componentType":5126,
"count":3,
"type":"VEC3",
"max":[
1.0,
0.5,
0.0
],
"min":[
0.0,
0.0,
0.0
]
},
{
"bufferView":1,
"byteOffset":36,
"componentType":5126,
"count":3,
"type":"VEC3",
"max":[
0.0,
1.0,
0.0
],
"min":[
-1.0,
0.0,
0.0
]
},
{
"bufferView":1,
"byteOffset":72,
"componentType":5126,
"count":3,
"type":"VEC3",
"max":[
1.0,
1.0,
0.0
],
"min":[
0.0,
0.0,
0.0
]
},
{
"bufferView":2,
"byteOffset":0,
"componentType":5126,
"count":5,
"type":"SCALAR",
"max":[
4.0
],
"min":[
0.0
]
},
{
"bufferView":3,
"byteOffset":0,
"componentType":5126,
"count":10,
"type":"SCALAR",
"max":[
1.0
],
"min":[
0.0
]
}
],

"asset":{
"version":"2.0"
}
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading