From 8acb4a0aad7f4d1b2438010d487489a9641e30cb Mon Sep 17 00:00:00 2001 From: Frederico Linhares Date: Sat, 23 Mar 2024 19:05:26 -0300 Subject: fixt Make skeletal mesh work properly --- test/src/mode/demo.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'test/src/mode/demo.rb') diff --git a/test/src/mode/demo.rb b/test/src/mode/demo.rb index a821d65..65ea52a 100644 --- a/test/src/mode/demo.rb +++ b/test/src/mode/demo.rb @@ -21,6 +21,7 @@ module Mode def initialize() texture = CandyGear::Texture.from_image("textures/color_texture.qoi"); mesh = CandyGear::StaticMesh.new("meshes/cube.cgmesh"); + skeletal_mesh = CandyGear::SkeletalMesh.new("meshes/cuboid.cgmesh"); font = CandyGear::Font.new("/usr/share/fonts/TTF/HanaMinA.ttf", 30); japanese_text = CandyGear::Texture.from_text( font, "こんにちは世界!"); @@ -66,11 +67,17 @@ module Mode mesh, texture, instance_positions[5], @instances_orientation) ] + skeletal_mesh_position = CandyGear::Vector3D.new(0.0, 0.0, 0.0); + skeletal_mesh_orientation = CandyGear::Orientation3D.new(0.0, 0.0, 0.0); + @skeletal_model = CandyGear::SkeletalModel.new( + skeletal_mesh, texture, skeletal_mesh_position, + skeletal_mesh_orientation); + sprite_3d_position = CandyGear::Vector3D.new(0.0, 0.0, 0.0); @sprite_3d = CandyGear::Sprite3D.new( @sprite, sprite_3d_position, 1.0, 1.0); - @camera_position = CandyGear::Vector3D.new(0.0, 0.0, 0.0); + @camera_position = CandyGear::Vector3D.new(0.0, 0.0, 20.0); @camera_orientation = CandyGear::Orientation3D.new(0.0, 0.0, 0.0); color = CandyGear::Vector3D.new(0.12, 0.12, 0.18); @@ -129,7 +136,8 @@ module Mode @instances_orientation.rotate(0.0, BOX_ROTATION_SPEED, 0.0); @rectangle.draw_rectangle(@view1, @color); @instances.each {_1.draw()}; - @sprite_3d.draw(); + @skeletal_model.draw(); + # @sprite_3d.draw(); end end end -- cgit v1.2.3