1
Есть ли предопределенное вращение по оси X в CGAL. Если нет, почему бы и нет? Если я должен это определить, как бы я это сделал?Вращение CGAL по оси x в 3D
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Aff_transformation_3.h>
#include <cmath>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Aff_transformation_3<Kernel> transform3D;
transform3D rotationX(double angle)
{
const double cosa{cos(angle)};
const double sina{sin(angle)};
return transform3D(
1.0, 0.0, 0.0,
0.0, cosa, -sina,
0.0, sina, cosa);
}
void test()
{
using Point3D = CGAL::Point_3<Kernel>;
Point3D p{1.0,1.0,1.0};
const transform3D rotate{rotationX(M_PI_2)};
rotate(p);
}