Skip to content
Snippets Groups Projects
Commit 66a49d23 authored by Marie AUDOUARD's avatar Marie AUDOUARD
Browse files

Added texture for bat and dragon + put all the bat files in a folder

parent cd633b7a
No related branches found
No related tags found
No related merge requests found
projet-code/scenes_inf443/base/assets/bat/bat_texture.jpg

78.8 KiB

projet-code/scenes_inf443/base/assets/bat/batw_texture.jpg

205 KiB

projet-code/scenes_inf443/base/assets/dragon/dragon_scales.jpg

337 KiB

......@@ -13,9 +13,9 @@ void bats::initialize_bats()
// Create the geometry of the meshes
// Note: this geometry must be set in their local coordinates with respect to their position in the hierarchy (and with respect to their animation)
body.initialize_data_on_gpu(mesh_load_file_obj(project::path + "assets/batbodyok.obj"));
wing1.initialize_data_on_gpu(mesh_load_file_obj(project::path + "assets/batwingleft.obj"));
wing2.initialize_data_on_gpu(mesh_load_file_obj(project::path + "assets/batwingright.obj"));
body.initialize_data_on_gpu(mesh_load_file_obj(project::path + "assets/bat/batbodyok.obj"));
wing1.initialize_data_on_gpu(mesh_load_file_obj(project::path + "assets/bat/batwingleft.obj"));
wing2.initialize_data_on_gpu(mesh_load_file_obj(project::path + "assets/bat/batwingright.obj"));
// Scale the model
//body.model.scaling = 0.2f;
......@@ -23,9 +23,22 @@ void bats::initialize_bats()
//wing2.model.scaling = 0.2f;
// Set the color of some elements
body.material.color = { 0.3f,0.3f,0.3f };
wing1.material.color = { 0.2f,0.2f,0.2f };
wing2.material.color = { 0.2f,0.2f,0.2f };
body.material.color = { 1,1,1 };
body.material.phong.specular = 0.0f;
wing1.material.color = { 0.4f,0.4f,0.4f };
wing1.material.phong.specular = 0.0f;
wing2.material.color = { 0.4f,0.4f,0.4f };
wing2.material.phong.specular = 0.0f;
body.texture.load_and_initialize_texture_2d_on_gpu(project::path + "assets/bat/bat_texture.jpg",
GL_REPEAT,
GL_REPEAT);
wing1.texture.load_and_initialize_texture_2d_on_gpu(project::path + "assets/bat/batw_texture.jpg",
GL_REPEAT,
GL_MIRRORED_REPEAT);
wing2.texture.load_and_initialize_texture_2d_on_gpu(project::path + "assets/bat/batw_texture.jpg",
GL_REPEAT,
GL_MIRRORED_REPEAT);
// Add the elements in the hierarchy
// The syntax is hierarchy.add(mesh_drawable, "name of the parent element", [optional: local translation in the hierarchy])
......
......@@ -30,11 +30,35 @@ void dragons::initialize_dragons()
// Set the color of some elements
body.material.color = { 0.6,0.15,0.1 };
body.material.phong.specular = 0.0f;
body.texture.load_and_initialize_texture_2d_on_gpu(project::path + "assets/dragon/dragon_scales.jpg",
GL_REPEAT,
GL_REPEAT);
wing1.material.color = { 0.6,0.15,0.1 };
wing1.material.phong.specular = 0.0f;
wing1.texture.load_and_initialize_texture_2d_on_gpu(project::path + "assets/dragon/dragon_scales.jpg",
GL_REPEAT,
GL_REPEAT);
wing2.material.color = { 0.6,0.15,0.1 };
wing2.material.phong.specular = 0.0f;
wing2.texture.load_and_initialize_texture_2d_on_gpu(project::path + "assets/dragon/dragon_scales.jpg",
GL_REPEAT,
GL_REPEAT);
mouth.material.color = { 0.6,0.15,0.1 };
mouth.material.phong.specular = 0.0f;
mouth.texture.load_and_initialize_texture_2d_on_gpu(project::path + "assets/dragon/dragon_scales.jpg",
GL_REPEAT,
GL_REPEAT);
tailmiddle.material.color = { 0.6,0.15,0.1 };
tailmiddle.material.phong.specular = 0.0f;
tailmiddle.texture.load_and_initialize_texture_2d_on_gpu(project::path + "assets/dragon/dragon_scales.jpg",
GL_REPEAT,
GL_REPEAT);
tailend.material.color = { 0.6,0.15,0.1 };
tailend.material.phong.specular = 0.0f;
tailend.texture.load_and_initialize_texture_2d_on_gpu(project::path + "assets/dragon/dragon_scales.jpg",
GL_REPEAT,
GL_REPEAT);
// Add the elements in the hierarchy
// The syntax is hierarchy.add(mesh_drawable, "name of the parent element", [optional: local translation in the hierarchy])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment