From d7d79214a93bc96b38ac018aad4c8d5ee88d51ca Mon Sep 17 00:00:00 2001 From: Frederico Linhares Date: Tue, 27 Sep 2022 17:38:20 -0300 Subject: feat Allow multiple textures to be used with the same mesh --- test/meshes/cube.cgmesh | Bin 0 -> 920 bytes test/meshes/tetrahedron.cgmesh | Bin 0 -> 376 bytes test/models/cube.cgmodel | Bin 920 -> 0 bytes test/models/tetrahedron.cgmodel | Bin 376 -> 0 bytes test/src/main.rb | 7 ++++--- 5 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 test/meshes/cube.cgmesh create mode 100644 test/meshes/tetrahedron.cgmesh delete mode 100644 test/models/cube.cgmodel delete mode 100644 test/models/tetrahedron.cgmodel (limited to 'test') diff --git a/test/meshes/cube.cgmesh b/test/meshes/cube.cgmesh new file mode 100644 index 0000000..5b0103e Binary files /dev/null and b/test/meshes/cube.cgmesh differ diff --git a/test/meshes/tetrahedron.cgmesh b/test/meshes/tetrahedron.cgmesh new file mode 100644 index 0000000..7a1f9b9 Binary files /dev/null and b/test/meshes/tetrahedron.cgmesh differ diff --git a/test/models/cube.cgmodel b/test/models/cube.cgmodel deleted file mode 100644 index 5b0103e..0000000 Binary files a/test/models/cube.cgmodel and /dev/null differ diff --git a/test/models/tetrahedron.cgmodel b/test/models/tetrahedron.cgmodel deleted file mode 100644 index 7a1f9b9..0000000 Binary files a/test/models/tetrahedron.cgmodel and /dev/null differ diff --git a/test/src/main.rb b/test/src/main.rb index b2e91e9..aaffbfb 100644 --- a/test/src/main.rb +++ b/test/src/main.rb @@ -17,10 +17,11 @@ BOX_ROTATION_SPEED = Math::PI/180; TRANSLATION_SPEED = 0.5; def init() - $texture = CandyGear::Texture.from_image("textures/color_texture.png"); - $model = CandyGear::Model.new("models/cube.cgmodel", $texture); + texture = CandyGear::Texture.from_image("textures/color_texture.png"); + mesh = CandyGear::Mesh.new("meshes/cube.cgmesh"); + $model = CandyGear::Model.new(mesh, texture); $sprite = CandyGear::Sprite.new( - $texture, CandyGear::Vector4D.new(0, 0, 1.0, 1.0)); + texture, CandyGear::Vector4D.new(0, 0, 1.0, 1.0)); $sprite_position = CandyGear::Vector4D.new(1.0, 1.0, 101.0, 101.0); $instances = [ -- cgit v1.2.3