36 #include <GLFW/glfw3.h> 39 #include <unordered_map> 42 namespace visualization {
45 const static std::unordered_map<int, GLenum> texture_format_map_ = {
46 {1, GL_RED}, {3, GL_RGB}, {4, GL_RGBA}};
47 const static std::unordered_map<int, GLenum> texture_type_map_ = {
48 {1, GL_UNSIGNED_BYTE}, {2, GL_UNSIGNED_SHORT}, {4, GL_FLOAT}};
50 typedef Eigen::Matrix<GLfloat, 3, 1, Eigen::ColMajor>
GLVector3f;
51 typedef Eigen::Matrix<GLfloat, 4, 1, Eigen::ColMajor>
GLVector4f;
52 typedef Eigen::Matrix<GLfloat, 4, 4, Eigen::ColMajor>
GLMatrix4f;
54 GLMatrix4f
LookAt(
const Eigen::Vector3d &eye,
55 const Eigen::Vector3d &lookat,
56 const Eigen::Vector3d &up);
63 GLMatrix4f
Ortho(
double left,
70 Eigen::Vector3d
Project(
const Eigen::Vector3d &point,
71 const GLMatrix4f &mvp_matrix,
75 Eigen::Vector3d
Unproject(
const Eigen::Vector3d &screen_point,
76 const GLMatrix4f &mvp_matrix,
Eigen::Matrix< GLfloat, 3, 1, Eigen::ColMajor > GLVector3f
Definition: GLHelper.h:50
Eigen::Vector3d Unproject(const Eigen::Vector3d &screen_point, const GLMatrix4f &mvp_matrix, const int width, const int height)
Definition: GLHelper.cpp:102
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
Eigen::Matrix< GLfloat, 4, 1, Eigen::ColMajor > GLVector4f
Definition: GLHelper.h:51
Eigen::Matrix< GLfloat, 4, 4, Eigen::ColMajor > GLMatrix4f
Definition: GLHelper.h:52
math::float4 color
Definition: LineSetBuffers.cpp:46
Eigen::Vector3d Project(const Eigen::Vector3d &point, const GLMatrix4f &mvp_matrix, const int width, const int height)
Definition: GLHelper.cpp:87
GLMatrix4f LookAt(const Eigen::Vector3d &eye, const Eigen::Vector3d &lookat, const Eigen::Vector3d &up)
Definition: GLHelper.cpp:36
Definition: Open3DViewer.h:29
int height
Definition: FilePCD.cpp:70
int width
Definition: FilePCD.cpp:69
GLMatrix4f Ortho(double left, double right, double bottom, double top, double z_near, double z_far)
Definition: GLHelper.cpp:70