Triangles!!!

This commit is contained in:
Godzil
2020-02-25 18:42:45 +00:00
parent 2ea4abdce7
commit aded6bb943
6 changed files with 179 additions and 2 deletions

View File

@@ -15,7 +15,7 @@
class Cube : public Shape {
private:
void checkAxis(double axeOrigine, double axeDirection, double *axeMin, double *axeMax);
void checkAxis(double axeOrigin, double axeDirection, double *axeMin, double *axeMax);
Intersect localIntersect(Ray r);

View File

@@ -27,6 +27,7 @@ enum ShapeType
SHAPE_CYLINDER,
SHAPE_CONE,
SHAPE_GROUP,
SHAPE_TRIANGLE,
};

28
source/include/triangle.h Normal file
View File

@@ -0,0 +1,28 @@
/*
* DoRayMe - a quick and dirty Raytracer
* Triangle header
*
* Created by Manoël Trapier
* Copyright (c) 2020 986-Studio.
*
*/
#ifndef DORAYME_TRIANGLE_H
#define DORAYME_TRIANGLE_H
#include <shape.h>
class Triangle : public Shape
{
Intersect localIntersect(Ray r);
Tuple localNormalAt(Tuple point);
public:
Tuple p1, p2, p3;
Tuple e1, e2;
Tuple normal;
public:
Triangle(Point p1, Point p2, Point p3);
};
#endif /* DORAYME_TRIANGLE_H */