Commit 088a9e39 authored by axel's avatar axel

--no commit message

--no commit message
parent 6451fa7a
......@@ -39,7 +39,7 @@ int main(int argc, char** argv)
FILE *file;
/*Creation d'une sphere : entite A (sphere rouge)*/
LrMatrix mat_A=LrMatrix::translate(LrVector(2, 0, 3)) * LrMatrix::scale(1.5);
LrMatrix mat_A=LrMatrix::translate(LrVector(0, 0, 10)) * LrMatrix::scale(4);
LrGeometrySphere geo_A;
LrColor c_bois1((uint8_t)136,(uint8_t)88,(uint8_t)0);
LrColor c_bois2((uint8_t)109,(uint8_t)60,(uint8_t)0);
......@@ -51,18 +51,18 @@ int main(int argc, char** argv)
LrEntityElementary sphere_A(mat_A, &geo_A, &opt_A);
/*Creation d'une sphere : entite B (sphere verte)*/
LrMatrix mat_B = LrMatrix::translate(LrVector(0, 15, -4)) * LrMatrix::scale(4);
LrMatrix mat_B = LrMatrix::translate(LrVector(2, 25, 5)) * LrMatrix::scale(2);
LrColor c_1((uint8_t)175,(uint8_t)17,(uint8_t)17);
LrColor c_2((uint8_t)0,(uint8_t)100,(uint8_t)100);
LrColor c_3((uint8_t)215,(uint8_t)21,(uint8_t)21);
LrPertColorTextProcTurbulence pcb_B(c_2, LrColor::WHITE, c_3, 1.0, 8);
LrPertColorTextProcTurbulence pcb_B(c_2, LrColor::YELLOW, c_3, 1.0, 4);
LrPertNormalBasic pnb_B;
LrOpticPhong opt_B(0.5, 0.5, 0, &pcb_B, &pnb_B, 50);
LrEntityElementary sphere_B(mat_B, &geo_A, &opt_B);
/*Creation d'une sphere : entite B (sphere du milieu)*/
LrMatrix mat_C = LrMatrix::translate(LrVector(0, 10, -3)) * LrMatrix::scale(3);
LrPertColorTextProcMarbre pcb_C(LrColor::BLACK, LrColor::WHITE, LrColor::GREY, 1, 2);
LrMatrix mat_C = LrMatrix::translate(LrVector(-4, 15, -3)) * LrMatrix::scale(3);
LrPertColorTextProcMarbre pcb_C(LrColor::BLACK, LrColor::WHITE, LrColor::GREY, 1, 4);
LrPertNormalBasic pnb_C;
LrOpticPhong opt_C(0.5, 0.5, 0, &pcb_C, &pnb_C, 50);
LrEntityElementary sphere_C(mat_C, &geo_A, &opt_C);
......@@ -88,8 +88,8 @@ int main(int argc, char** argv)
//Creation d'une lumiere point : entite X (lumiere de droite)
LrMatrix mat_lum_X = LrMatrix::translate(LrVector(-5, -8, 5));
LrEntityLightPoint lum_X(mat_lum_X, LrColor(0.8f,0.8f,0.8f));
//LrEntityLightPoint lum_X(mat_lum_X, LrColor(0.8f,0.8f,0.8f));
LrEntityLightPlane lum_X(mat_lum_X, LrColor(0.3f,0.3f,0.3f),10);
//Creation d'une lumiere point : entite Y (Lumiere au plafond)
LrMatrix mat_lum_Y = LrMatrix::translate(LrVector(0, 0, 20));
......@@ -97,44 +97,44 @@ int main(int argc, char** argv)
//Creation d'une lumiere point : entite Z (Lumiere de gauche)
LrMatrix mat_lum_Z = LrMatrix::translate(LrVector(5, 0, 5));
LrEntityLightPoint lum_Z(mat_lum_Z, LrColor(0.8f,0.8f,0.8f));
//LrEntityLightPoint lum_Z(mat_lum_Z, LrColor(0.8f,0.8f,0.8f));
LrEntityLightPlane lum_Z(mat_lum_Z, LrColor(0.3f,0.3f,0.3f),10);
//Creation de la Liste des entites-lumieres et ajout des entites-lumieres dans cette liste
LrScene::LrEntityList list_lights;
list_lights.push_back(&lum_Z);
//list_lights.push_back(&lum_Y);
list_lights.push_back(&lum_Y);
list_lights.push_back(&lum_X);
//Creation de la Liste des entites et ajout des entites dans cette liste
LrScene::LrEntityList list_entities;
//list_entities.push_back(&sphere_A);
list_entities.push_back(&sphere_A);
list_entities.push_back(&sphere_C);
//list_entities.push_back(&cube_D);
list_entities.push_back(&plan_E);
//list_entities.push_back(&sphere_B);
list_entities.push_back(&sphere_B);
//La structure acceleratrice
LrBinderSimple bind_A(list_entities);
//Image et camera
LrImage img_A(600,600);
LrPoint pt_origine_cam(0, -5, 0);
LrCameraPlane cam_A(pt_origine_cam,LrVector::K,LrVector::J,M_PI/2,M_PI/2);
LrPoint pt_origine_cam(0, -20, 0);
LrCameraPlane cam_A(pt_origine_cam,LrVector::K,LrVector::J,M_PI/4,M_PI/4);
//L'antiAliasing
//LrAntiAliasingCentre aa(1);
//LrAntiAliasingRandom aa(1);
LrAntiAliasingCentre aa(2);
//LrAntiAliasingCentre aa(2);
//LrAntiAliasingRandom aa(2);
//LrAntiAliasingCentre aa(4);
//LrAntiAliasingRandom aa(4);
LrAntiAliasingRandom aa(4);
//La scene avec 5 rebonds
......@@ -142,7 +142,7 @@ int main(int argc, char** argv)
cout<<"RayTracing Start..."<< endl;
//Lancement de l'algorithme de lancer de rayons (parametre : nb de threads)
scene_A.generateImage(2);
scene_A.generateImage(8);
//Sauvegarde de l'image
file = fopen("./test21.ppm","wb");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment