mirror of
https://github.com/allemangD/toddcox-visualize.git
synced 2025-11-10 12:02:47 -05:00
add basic 4d rotation matrix utility
This commit is contained in:
@@ -105,3 +105,12 @@ std::vector<glm::vec4> plane_intersections(std::vector<glm::vec4> normals) {
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
glm::mat4 utilRotate(const int u, const int v, const float theta) {
|
||||
auto res = glm::identity<glm::mat4>();
|
||||
res[u][u] = std::cos(theta);
|
||||
res[u][v] = std::sin(theta);
|
||||
res[v][u] = -std::sin(theta);
|
||||
res[v][v] = std::cos(theta);
|
||||
return res;
|
||||
}
|
||||
Reference in New Issue
Block a user