point generation working; still needs broken into functions though.

This commit is contained in:
2020-01-04 15:01:33 -05:00
parent 5026daefec
commit 624edb3bbb
6 changed files with 130 additions and 11 deletions

View File

@@ -5,6 +5,10 @@
#include <tc/groups.h>
#include <tc/solver.h>
#include "geom.h"
#include <glm/gtx/string_cast.hpp>
#ifdef _WIN32
extern "C" {
__attribute__((unused)) __declspec(dllexport) int NvOptimusEnablement = 0x00000001;
@@ -39,13 +43,34 @@ int main(int argc, char *argv[]) {
<< " OpenGL version: " << glGetString(GL_VERSION) << std::endl
<< " Shading version: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl;
auto group = tc::group::A(5);
auto group = tc::group::B(4);
auto res = tc::solve(group);
std::cout
<< "Coset Solution Test:" << std::endl
<< " Group: " << group.name << std::endl
<< " Order: " << res.len << std::endl;
auto mirrors = mirror(group);
std::cout << "Mirrors:" << std::endl;
for (const auto &mirror : mirrors) {
std::cout << " " << glm::to_string(mirror) << std::endl;
}
auto corners = plane_intersections(mirrors);
auto points = std::vector<glm::vec4>(res.size());
points[0] = barycentric(corners, {1, 0, 0, 0});
for (int i = 1; i < res.size(); i++) {
auto action = res.path[i];
points[i] = reflect(points[action.coset], mirrors[action.gen]);
}
std::cout << "Points:" << std::endl;
for (const auto &point : points) {
std::cout << " " << to_string(point) << std::endl;
}
while (!glfwWindowShouldClose(window)) {
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(window);
@@ -55,4 +80,4 @@ int main(int argc, char *argv[]) {
glfwTerminate();
return EXIT_SUCCESS;
}
}