up_axis.cpp 837 B

12345678910111213141516171819202122232425262728
  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. #include "../opengl/OpenGL_convenience.h"
  10. IGL_INLINE void igl::opengl2::up_axis(double * x, double * y, double * z)
  11. {
  12. double mv[16];
  13. glGetDoublev(GL_MODELVIEW_MATRIX, mv);
  14. igl::opengl2::up_axis(mv,x,y,z);
  15. }
  16. IGL_INLINE void igl::opengl2::up_axis(const double *mv, double * x, double * y, double * z)
  17. {
  18. *x = -mv[0*4+1];
  19. *y = -mv[1*4+1];
  20. *z = -mv[2*4+1];
  21. }
  22. #ifdef IGL_STATIC_LIBRARY
  23. // Explicit template specialization
  24. // generated by autoexplicit.sh
  25. #endif