view_axis.cpp 737 B

1234567891011121314151617181920212223242526
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #include "view_axis.h"
  9. #ifndef IGL_NO_OPENGL
  10. #include "OpenGL_convenience.h"
  11. IGL_INLINE void igl::view_axis(double * x, double * y, double * z)
  12. {
  13. double mv[16];
  14. glGetDoublev(GL_MODELVIEW_MATRIX, mv);
  15. igl::view_axis(mv,x,y,z);
  16. }
  17. IGL_INLINE void igl::view_axis(const double * mv, double * x, double * y, double * z)
  18. {
  19. *x = -mv[0*4+2];
  20. *y = -mv[1*4+2];
  21. *z = -mv[2*4+2];
  22. }
  23. #endif