kdtree/main.cpp

22 lines
704 B
C++
Raw Normal View History

2020-12-28 13:55:57 +01:00
#include "kdtree.h"
2020-12-09 13:09:35 +01:00
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
2020-12-28 13:55:57 +01:00
// 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)};
2020-12-28 13:55:57 +01:00
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}));
2020-12-09 13:09:35 +01:00
return 0;
}