This commit is contained in:
s473621 2024-03-18 16:48:46 +01:00
parent a0c5486450
commit 5179989830
6 changed files with 78 additions and 61 deletions

View File

@ -11,6 +11,6 @@ Pos=4,3
Size=218,129 Size=218,129
[Window][Dodawanie nowej planety] [Window][Dodawanie nowej planety]
Pos=133,-20 Pos=132,-14
Size=282,169 Size=282,169

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

View File

@ -9,4 +9,4 @@ Ke 0.000000 0.000000 0.000000
Ni 1.450000 Ni 1.450000
d 1.000000 d 1.000000
illum 2 illum 2
map_Kd C:/Users/neryt/meshlab_pl/ros1.png map_Kd C:/Users/neryt/meshlab_pl/Picsart_24-03-18_14-50-34-891.jpg

View File

@ -9,4 +9,4 @@ Ke 0.000000 0.000000 0.000000
Ni 1.450000 Ni 1.450000
d 1.000000 d 1.000000
illum 2 illum 2
map_Kd C:/Users/neryt/meshlab_pl/ros3.jpg map_Kd ./models/ros2.png

View File

@ -56,7 +56,7 @@ void main() {
float NdotH = max(dot(normal, H), 0.0); float NdotH = max(dot(normal, H), 0.0);
float LdotH = max(dot(lightDir, H), 0.0); float LdotH = max(dot(lightDir, H), 0.0);
int texIndex = 0; // Example: set the default texture index int texIndex = 0;
vec3 albedoTex = texture(textures[texIndex], texCoords).rgb; vec3 albedoTex = texture(textures[texIndex], texCoords).rgb;
albedoTex = vec3(smoothstep(0.0, 1.0, albedoTex)); albedoTex = vec3(smoothstep(0.0, 1.0, albedoTex));

View File

@ -763,7 +763,7 @@ void renderScene(GLFWwindow* window)
glm::vec3 plantPosition1 = glm::vec3(1.f, 0.f, 1.5f); glm::vec3 plantPosition1 = glm::vec3(1.f, 0.f, 1.5f);
glm::vec3 plantPosition2 = glm::vec3(1.f, 0.f, 0.5f); glm::vec3 plantPosition2 = glm::vec3(1.f, 0.f, 0.5f);
glm::vec3 plantPosition3 = glm::vec3(1.f, 0.f, -0.5f); glm::vec3 plantPosition3 = glm::vec3(1.f, 0.f, -0.5f);
renderSun(); //renderSun();
//float scaleFactor = 0.025f; //float scaleFactor = 0.025f;
//glm::mat4 plantModelMatrix = glm::translate(plantPosition) * glm::scale(glm::vec3(scaleFactor)); //glm::mat4 plantModelMatrix = glm::translate(plantPosition) * glm::scale(glm::vec3(scaleFactor));
for (const auto& planet : planets) { for (const auto& planet : planets) {
@ -967,7 +967,7 @@ void init(GLFWwindow* window)
} }
*/ */
/*
std::string plant_name_3 = "testPlant3"; std::string plant_name_3 = "testPlant3";
std::string model_name_3 = "./models/roslina3.obj"; std::string model_name_3 = "./models/roslina3.obj";
int random_value_1_3 = rand() % 101; int random_value_1_3 = rand() % 101;
@ -1080,24 +1080,50 @@ void init(GLFWwindow* window)
int random_value_2_54 = rand() % 11; int random_value_2_54 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_54, random_value_2_54, random_value_1_54, random_value_2_54, plant_name_54, model_name_54, roslina54Material)); plant_specimens.push_back(Plant::Plant(random_value_1_54, random_value_2_54, random_value_1_54, random_value_2_54, plant_name_54, model_name_54, roslina54Material));
/*
std::string plant_name_1 = "testPlant1";
std::string model_name_1 = "./models/roslina1.obj";
int random_value_1_1 = rand() % 101;
int random_value_2_1 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_1, random_value_2_1, random_value_1_1, random_value_2_1, plant_name_1, model_name_1, roslina1Material));
std::string plant_name_2 = "testPlant2";
std::string model_name_2 = "./models/roslina2.obj";
int random_value_1_2 = rand() % 101;
int random_value_2_2 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_2, random_value_2_2, random_value_1_2, random_value_2_2, plant_name_2, model_name_2, roslina2Material));
std::string plant_name_3 = "testPlant3"; std::string plant_name_3 = "testPlant3";
std::string model_name_3 = "./models/roslina3.obj"; std::string model_name_3 = "./models/roslina3.obj";
int random_value_1_3 = rand() % 101; int random_value_1_3 = rand() % 101;
int random_value_2_3 = rand() % 11; int random_value_2_3 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_3, random_value_2_3, random_value_1_3, random_value_2_3, plant_name_3, model_name_3, roslina3Material)); plant_specimens.push_back(Plant::Plant(random_value_1_3, random_value_2_3, random_value_1_3, random_value_2_3, plant_name_3, model_name_3, roslina3Material));
*/
std::string plant_name_2 = "testPlant2";
std::string model_name_2 = "./models/roslina2.obj";
int random_value_1_2 = rand() % 101;
int random_value_2_2 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_2, random_value_2_2, random_value_1_2, random_value_2_2, plant_name_2, model_name_2, roslina3Material));
std::string plant_name_6 = "testPlant6";
std::string model_name_6 = "./models/roslina6.obj";
int random_value_1_6 = rand() % 101;
int random_value_2_6 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_6, random_value_2_6, random_value_1_6, random_value_2_6, plant_name_6, model_name_6, roslina6Material));
std::string plant_name_7 = "testPlant7";
std::string model_name_7 = "./models/roslina7.obj";
int random_value_1_7 = rand() % 101;
int random_value_2_7 = rand() % 11;
//plant_specimens.push_back(Plant::Plant(random_value_1_7, random_value_2_7, random_value_1_7, random_value_2_7, plant_name_7, model_name_7, roslina7Material));
std::string plant_name_21 = "testPlant21";
std::string model_name_21 = "./models/roslina21.obj";
int random_value_1_21 = rand() % 101;
int random_value_2_21 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_21, random_value_2_21, random_value_1_21, random_value_2_21, plant_name_21, model_name_21, roslina21Material));
std::string plant_name_1 = "testPlant1";
std::string model_name_1 = "./models/roslina1.obj";
int random_value_1_1 = rand() % 101;
int random_value_2_1 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_1, random_value_2_1, random_value_1_1, random_value_2_1, plant_name_1, model_name_1, roslina1Material));
std::string plant_name_4 = "testPlant4"; std::string plant_name_4 = "testPlant4";
std::string model_name_4 = "./models/roslina4.obj"; std::string model_name_4 = "./models/roslina4.obj";
@ -1105,53 +1131,20 @@ void init(GLFWwindow* window)
int random_value_2_4 = rand() % 11; int random_value_2_4 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_4, random_value_2_4, random_value_1_4, random_value_2_4, plant_name_4, model_name_4, roslina4Material)); plant_specimens.push_back(Plant::Plant(random_value_1_4, random_value_2_4, random_value_1_4, random_value_2_4, plant_name_4, model_name_4, roslina4Material));
std::string plant_name_5 = "testPlant5";
std::string model_name_5 = "./models/roslina5.obj";
int random_value_1_5 = rand() % 101;
int random_value_2_5 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_5, random_value_2_5, random_value_1_5, random_value_2_5, plant_name_5, model_name_5, roslina5Material));
std::string plant_name_6 = "testPlant6";
std::string model_name_6 = "./models/roslina6.obj";
int random_value_1_6 = rand() % 101;
int random_value_2_6 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_6, random_value_2_6, random_value_1_6, random_value_2_6, plant_name_6, model_name_6, roslina6Material));
std::string plant_name_7 = "testPlant7";
std::string model_name_7 = "./models/roslina7.obj";
int random_value_1_7 = rand() % 101;
int random_value_2_7 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_7, random_value_2_7, random_value_1_7, random_value_2_7, plant_name_7, model_name_7, roslina7Material));
std::string plant_name_9 = "testPlant9"; std::string plant_name_9 = "testPlant9";
std::string model_name_9 = "./models/roslina9.obj"; std::string model_name_9 = "./models/roslina9.obj";
int random_value_1_9 = rand() % 101; int random_value_1_9 = rand() % 101;
int random_value_2_9 = rand() % 11; int random_value_2_9 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_9, random_value_2_9, random_value_1_9, random_value_2_9, plant_name_9, model_name_9, roslina9Material)); plant_specimens.push_back(Plant::Plant(random_value_1_9, random_value_2_9, random_value_1_9, random_value_2_9, plant_name_9, model_name_9, roslina9Material));
std::string plant_name_13 = "testPlant13"; std::string plant_name_13 = "testPlant13";
std::string model_name_13 = "./models/roslina13.obj"; std::string model_name_13 = "./models/roslina13.obj";
int random_value_1_13 = rand() % 101; int random_value_1_13 = rand() % 101;
int random_value_2_13 = rand() % 11; int random_value_2_13 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_13, random_value_2_13, random_value_1_13, random_value_2_13, plant_name_13, model_name_13, roslina13Material)); plant_specimens.push_back(Plant::Plant(random_value_1_13, random_value_2_13, random_value_1_13, random_value_2_13, plant_name_13, model_name_13, roslina13Material));
std::string plant_name_19 = "testPlant19";
std::string model_name_19 = "./models/roslina19.obj";
int random_value_1_19 = rand() % 101;
int random_value_2_19 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_19, random_value_2_19, random_value_1_19, random_value_2_19, plant_name_19, model_name_19, roslina19Material));
std::string plant_name_20 = "testPlant20";
std::string model_name_20 = "./models/roslina20.obj";
int random_value_1_20 = rand() % 101;
int random_value_2_20 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_20, random_value_2_20, random_value_1_20, random_value_2_20, plant_name_20, model_name_20, roslina20Material));
std::string plant_name_21 = "testPlant21";
std::string model_name_21 = "./models/roslina21.obj";
int random_value_1_21 = rand() % 101;
int random_value_2_21 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_21, random_value_2_21, random_value_1_21, random_value_2_21, plant_name_21, model_name_21, roslina21Material));
std::string plant_name_22 = "testPlant22"; std::string plant_name_22 = "testPlant22";
std::string model_name_22 = "./models/roslina22.obj"; std::string model_name_22 = "./models/roslina22.obj";
@ -1159,18 +1152,42 @@ void init(GLFWwindow* window)
int random_value_2_22 = rand() % 11; int random_value_2_22 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_22, random_value_2_22, random_value_1_22, random_value_2_22, plant_name_22, model_name_22, roslina22Material)); plant_specimens.push_back(Plant::Plant(random_value_1_22, random_value_2_22, random_value_1_22, random_value_2_22, plant_name_22, model_name_22, roslina22Material));
std::string plant_name_23 = "testPlant23";
std::string model_name_23 = "./models/roslina23.obj";
int random_value_1_23 = rand() % 101;
int random_value_2_23 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_23, random_value_2_23, random_value_1_23, random_value_2_23, plant_name_23, model_name_23, roslina23Material));
std::string plant_name_24 = "testPlant24"; std::string plant_name_24 = "testPlant24";
std::string model_name_24 = "./models/roslina24.obj"; std::string model_name_24 = "./models/roslina24.obj";
int random_value_1_24 = rand() % 101; int random_value_1_24 = rand() % 101;
int random_value_2_24 = rand() % 11; int random_value_2_24 = rand() % 11;
plant_specimens.push_back(Plant::Plant(random_value_1_24, random_value_2_24, random_value_1_24, random_value_2_24, plant_name_24, model_name_24, roslina24Material)); //plant_specimens.push_back(Plant::Plant(random_value_1_24, random_value_2_24, random_value_1_24, random_value_2_24, plant_name_24, model_name_24, roslina24Material));
*/
std::string plant_name_5 = "testPlant5";
std::string model_name_5 = "./models/roslina5.obj";
int random_value_1_5 = rand() % 101;
int random_value_2_5 = rand() % 11;
//plant_specimens.push_back(Plant::Plant(random_value_1_5, random_value_2_5, random_value_1_5, random_value_2_5, plant_name_5, model_name_5, roslina5Material));
std::string plant_name_19 = "testPlant19";
std::string model_name_19 = "./models/roslina19.obj";
int random_value_1_19 = rand() % 101;
int random_value_2_19 = rand() % 11;
//plant_specimens.push_back(Plant::Plant(random_value_1_19, random_value_2_19, random_value_1_19, random_value_2_19, plant_name_19, model_name_19, roslina19Material));
std::string plant_name_20 = "testPlant20";
std::string model_name_20 = "./models/roslina20.obj";
int random_value_1_20 = rand() % 101;
int random_value_2_20 = rand() % 11;
//plant_specimens.push_back(Plant::Plant(random_value_1_20, random_value_2_20, random_value_1_20, random_value_2_20, plant_name_20, model_name_20, roslina20Material));
std::string plant_name_23 = "testPlant23";
std::string model_name_23 = "./models/roslina23.obj";
int random_value_1_23 = rand() % 101;
int random_value_2_23 = rand() % 11;
// plant_specimens.push_back(Plant::Plant(random_value_1_23, random_value_2_23, random_value_1_23, random_value_2_23, plant_name_23, model_name_23, roslina23Material));
defaultTexture = Core::LoadTexture("textures/1.png"); defaultTexture = Core::LoadTexture("textures/1.png");
if (defaultTexture == 0) { if (defaultTexture == 0) {