unproject_to_zero_plane.h 770 B

123456789101112131415161718192021222324252627
  1. #ifndef IGL_UNPROJECT_TO_ZERO_PLANE_H
  2. #define IGL_UNPROJECT_TO_ZERO_PLANE_H
  3. #include "igl_inline.h"
  4. namespace igl
  5. {
  6. // Wrapper for gluUnproject that uses the current GL_MODELVIEW_MATRIX,
  7. // GL_PROJECTION_MATRIX, and GL_VIEWPORT to unproject a screen postion
  8. // (winX,winY) to a 3d location at same depth as the current origin.
  9. // Inputs:
  10. // win* screen space x, y, and z coordinates respectively
  11. // Outputs:
  12. // obj* pointers to 3D objects' x, y, and z coordinates respectively
  13. // Returns return value of gluUnProject call
  14. IGL_INLINE int unproject_to_zero_plane(
  15. const double winX,
  16. const double winY,
  17. double* objX,
  18. double* objY,
  19. double* objZ);
  20. }
  21. #ifdef IGL_HEADER_ONLY
  22. # include "unproject_to_zero_plane.cpp"
  23. #endif
  24. #endif