Skip to content
Extraits de code Groupes Projets
Valider 902290eb rédigé par Acheroufkebir Yacine's avatar Acheroufkebir Yacine
Parcourir les fichiers

IRAN

parent ed87d410
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -164,7 +164,7 @@ int main()
shapes[2] = new Quad(grey, Vector3f(width/2, height, depth/2), width, 0, depth); //plafond
shapes[3] = new Quad(grey, Vector3f(0, height/2, depth/2), 0, height, depth); //mur droit
shapes[4] = new Quad(grey, Vector3f(width/2, 0, depth/2), width, 0, depth); //sol
shapes[5] = new Quad(red, Vector3f(width/4, 20, depth-20), 40, 40, 40); //cube
shapes[5] = new Quad(red, Vector3f(50, 50, 50), 5, 5, 5); //cube
shapes[6] = new Sphere(blue, Vector3f(3/4*width, 20, depth/2), 40); //sphere
Camera camera(Vector3f(width/2, height/2, 0), Vector3f(0, 0, 1));
......
......@@ -149,7 +149,7 @@ Ray3f Quad::reflect(const Ray3f ray) const
if (t>0 && y5<=y && y<=y2 && z6<=z && z3<=z)
{
Vector3f hit = ray.origin() + t*ray.direction();
Vector3f N = hit-origin_;
Vector3f N = Vector3f(1,0,0);
N.normalize();
}
}
......@@ -164,7 +164,7 @@ Ray3f Quad::reflect(const Ray3f ray) const
if (t>0 && x4<=x && x<=x1 && z6<=z && z3<=z)
{
Vector3f hit = ray.origin() + t*ray.direction();
Vector3f N = hit-origin_;
Vector3f N = Vector3f(0,1,0);
N.normalize();
}
}
......@@ -180,7 +180,7 @@ Ray3f Quad::reflect(const Ray3f ray) const
if (t>0 && x4<=x && x<=x1 && y5<=y && y<=y2)
{
Vector3f hit = ray.origin() + t*ray.direction();
Vector3f N = hit-origin_;
Vector3f N = Vector3f(0,0,1);
N.normalize();
}
}
......@@ -196,7 +196,7 @@ Ray3f Quad::reflect(const Ray3f ray) const
if (t>0 && y5<=y && y<= y2 && z6<=z && z3<=z)
{
Vector3f hit = ray.origin() + t*ray.direction();
Vector3f N = hit-origin_;
Vector3f N = Vector3f(-1,0,0);
N.normalize();
}
}
......@@ -212,7 +212,7 @@ Ray3f Quad::reflect(const Ray3f ray) const
if (t>0 && x4<=x && x<=x1 && z6<=z && z3<=z)
{
Vector3f hit = ray.origin() + t*ray.direction();
Vector3f N = hit-origin_;
Vector3f N = Vector3f(0,-1,0);
N.normalize();
}
}
......@@ -228,7 +228,7 @@ Ray3f Quad::reflect(const Ray3f ray) const
if (t>0 && x4<=x && x<=x1 && y5<=y && y<=y2)
{
Vector3f hit = ray.origin() + t*ray.direction();
Vector3f N = hit-origin_;
Vector3f N = Vector3f(0,0,-1);
N.normalize();
}
}
......
......@@ -6,6 +6,7 @@ Ray3f::Ray3f(const Vector3f & ori, const Vector3f & dir)
{
origin_ = ori;
direction_ = dir;
direction_.normalize();
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter