kdtree/main.cpp
karl 71841766f1 Rough cout implementation of ray intersection order
The order in which nodes are checked seems to be correct
2020-12-28 16:00:29 +01:00

22 lines
704 B
C++

#include "kdtree.h"
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
// Test points
std::vector<Point *> points{new Point(new float[3]{0.0, 0.0, 0.0}, nullptr),
new Point(new float[3]{0.0, 1.0, 0.0}, nullptr),
new Point(new float[3]{0.0, 2.0, 3.0}, nullptr),
new Point(new float[3]{1.0, 0.0, 4.0}, nullptr),
new Point(new float[3]{1.0, -1.0, 8.0}, nullptr)};
KDTree tree = KDTree(points);
std::cout << tree.to_string();
tree.intersect_ray(Ray(new float[3]{0.0, 0.0, 5.0}, new float[3]{0.0, 0.0, -1.0}));
return 0;
}