36 #include <GLFW/glfw3.h> 40 #include <unordered_map> 43 namespace visualization {
46 const static std::unordered_map<int, GLenum> texture_format_map_ = {
47 {1, GL_RED}, {3, GL_RGB}, {4, GL_RGBA}};
48 const static std::unordered_map<int, GLenum> texture_type_map_ = {
49 {1, GL_UNSIGNED_BYTE}, {2, GL_UNSIGNED_SHORT}, {4, GL_FLOAT}};
51 typedef Eigen::Matrix<GLfloat, 3, 1, Eigen::ColMajor>
GLVector3f;
52 typedef Eigen::Matrix<GLfloat, 4, 1, Eigen::ColMajor>
GLVector4f;
53 typedef Eigen::Matrix<GLfloat, 4, 4, Eigen::ColMajor>
GLMatrix4f;
55 GLMatrix4f
LookAt(
const Eigen::Vector3d &eye,
56 const Eigen::Vector3d &lookat,
57 const Eigen::Vector3d &up);
64 GLMatrix4f
Ortho(
double left,
71 Eigen::Vector3d
Project(
const Eigen::Vector3d &point,
72 const GLMatrix4f &mvp_matrix,
76 Eigen::Vector3d
Unproject(
const Eigen::Vector3d &screen_point,
77 const GLMatrix4f &mvp_matrix,
Eigen::Vector3d Project(const Eigen::Vector3d &point, const GLMatrix4f &mvp_matrix, const int width, const int height)
Definition: GLHelper.cpp:87
Eigen::Matrix< GLfloat, 4, 4, Eigen::ColMajor > GLMatrix4f
Definition: GLHelper.h:53
Eigen::Matrix< GLfloat, 4, 1, Eigen::ColMajor > GLVector4f
Definition: GLHelper.h:52
Eigen::Vector3d Unproject(const Eigen::Vector3d &screen_point, const GLMatrix4f &mvp_matrix, const int width, const int height)
Definition: GLHelper.cpp:102
math::float4 color
Definition: LineSetBuffers.cpp:63
Eigen::Matrix< GLfloat, 3, 1, Eigen::ColMajor > GLVector3f
Definition: GLHelper.h:51
GLMatrix4f LookAt(const Eigen::Vector3d &eye, const Eigen::Vector3d &lookat, const Eigen::Vector3d &up)
Definition: GLHelper.cpp:36
int ColorCodeToPickIndex(const Eigen::Vector4i &color)
Definition: GLHelper.cpp:118
GLMatrix4f Perspective(double field_of_view_, double aspect, double z_near, double z_far)
Definition: GLHelper.cpp:55
Definition: PinholeCameraIntrinsic.cpp:35
int height
Definition: FilePCD.cpp:72
GLMatrix4f Ortho(double left, double right, double bottom, double top, double z_near, double z_far)
Definition: GLHelper.cpp:70
int width
Definition: FilePCD.cpp:71