Merge branch 'master' of git.cg.cs.tu-bs.de:CG1_WS2223/group_12
This commit is contained in:
commit
e20d852d53
2 changed files with 4 additions and 4 deletions
|
@ -36,9 +36,9 @@ bool Sphere::intersect(Ray &ray) const {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Calculate the normal
|
// Calculate the normal
|
||||||
auto intersectPoint = ray.origin + ray.direction * t;
|
auto intersectPoint = ray.origin + ray.direction * t;
|
||||||
auto normalDirection = intersectPoint - this->center; // Point of intersect - origin of sphere creates a line along the normal, pointing outwards
|
auto normalDirection = intersectPoint - this->center; // Point of intersect - origin of sphere creates a line along the normal, pointing outwards
|
||||||
ray.normal = normalized(normalDirection);
|
ray.normal = normalized(normalDirection);
|
||||||
|
|
||||||
// Calculate the surface position and tangent vector
|
// Calculate the surface position and tangent vector
|
||||||
float const phi = std::acos(ray.normal.y);
|
float const phi = std::acos(ray.normal.y);
|
||||||
|
|
|
@ -101,7 +101,7 @@ bool Triangle::intersect(Ray &ray) const {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Calculate the normal
|
// Calculate the normal
|
||||||
// IMPLEMENT ME
|
ray.normal = crossProduct(edge1, edge1);
|
||||||
|
|
||||||
// Calculate the surface position
|
// Calculate the surface position
|
||||||
ray.surface = u * this->surface[1] + v * this->surface[2] + (1 - u - v) * this->surface[0];
|
ray.surface = u * this->surface[1] + v * this->surface[2] + (1 - u - v) * this->surface[0];
|
||||||
|
|
Loading…
Reference in a new issue