up_axis.cpp 729 B

123456789101112131415161718192021222324252627
  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 "up_axis.h"
  9. #ifndef IGL_NO_OPENGL
  10. #include "OpenGL_convenience.h"
  11. IGL_INLINE void igl::up_axis(double * x, double * y, double * z)
  12. {
  13. double mv[16];
  14. glGetDoublev(GL_MODELVIEW_MATRIX, mv);
  15. igl::up_axis(mv,x,y,z);
  16. }
  17. IGL_INLINE void igl::up_axis(const double *mv, double * x, double * y, double * z)
  18. {
  19. *x = -mv[0*4+1];
  20. *y = -mv[1*4+1];
  21. *z = -mv[2*4+1];
  22. }
  23. #endif