diff options
author | Frederico Linhares <fred@linhares.blue> | 2022-09-27 17:38:20 -0300 |
---|---|---|
committer | Frederico Linhares <fred@linhares.blue> | 2022-09-29 11:37:05 -0300 |
commit | d7d79214a93bc96b38ac018aad4c8d5ee88d51ca (patch) | |
tree | 25528c9bd91556f3d1d5d35a5d2c52d3d7d8a5a8 /test | |
parent | 28de1fe8713aba2c4bb23fc8640adb2747373b66 (diff) |
feat Allow multiple textures to be used with the same mesh
Diffstat (limited to 'test')
-rw-r--r-- | test/meshes/cube.cgmesh (renamed from test/models/cube.cgmodel) | bin | 920 -> 920 bytes | |||
-rw-r--r-- | test/meshes/tetrahedron.cgmesh (renamed from test/models/tetrahedron.cgmodel) | bin | 376 -> 376 bytes | |||
-rw-r--r-- | test/src/main.rb | 7 |
3 files changed, 4 insertions, 3 deletions
diff --git a/test/models/cube.cgmodel b/test/meshes/cube.cgmesh Binary files differindex 5b0103e..5b0103e 100644 --- a/test/models/cube.cgmodel +++ b/test/meshes/cube.cgmesh diff --git a/test/models/tetrahedron.cgmodel b/test/meshes/tetrahedron.cgmesh Binary files differindex 7a1f9b9..7a1f9b9 100644 --- a/test/models/tetrahedron.cgmodel +++ b/test/meshes/tetrahedron.cgmesh 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 = [ |