Is glm::ortho() actually wrong?

It doesn’t appear that it should be broken from the source code (v 0.9.3.4) template <typename valType> GLM_FUNC_QUALIFIER detail::tmat4x4<valType> ortho ( valType const & left, valType const & right, valType const & bottom, valType const & top, valType const & zNear, valType const & zFar ) { detail::tmat4x4<valType> Result(1); Result[0][0] = valType(2) / (right – … Read more

How to create random orthonormal matrix in python numpy

Version 0.18 of scipy has scipy.stats.ortho_group and scipy.stats.special_ortho_group. The pull request where it was added is https://github.com/scipy/scipy/pull/5622 For example, In [24]: from scipy.stats import ortho_group # Requires version 0.18 of scipy In [25]: m = ortho_group.rvs(dim=3) In [26]: m Out[26]: array([[-0.23939017, 0.58743526, -0.77305379], [ 0.81921268, -0.30515101, -0.48556508], [-0.52113619, -0.74953498, -0.40818426]]) In [27]: np.set_printoptions(suppress=True) In [28]: … Read more