[英]GLM - rotation makes objects disappear
I'm doing the rotation on two objects in OpenGL. 我正在对OpenGL中的两个对象进行旋转。 one which works:
一种有效的方法:
Model1 = glm::translate( ... );
Model1 = glm::scale( ... );
Model1 = glm::rotate(Model1, 90 , glm::vec3(1,0,0));
and one which doesnt: 还有一个没有:
Model2 = glm::translate( ... );
Model2 = glm::scale( ... );
Model2 = glm::rotate(Model2, 90 , glm::vec3(0,0,0));
which makes my Object disappear. 这使我的对象消失了。
I assume this is caused due to multiplication by 0 (or sth similar). 我认为这是由于乘以0(或类似的东西)引起的。 Then, how should I represent No rotation?
那么,我该如何表示不旋转?
Is axis-angle a good way of using rotations, or one should store them as quaternions and use a different function or convert back to angle-axis each time Rotation is being applied? 轴角度是使用旋转的一种好方法,还是应该将它们存储为四元数并使用其他函数,或者在每次应用旋转时转换回角度轴?
Then, how should I represent No rotation?
那么,我该如何表示不旋转?
By an angle of 0 (instead of 90). 倾斜角度为0(而不是90)。 Not by degenerating the rotation axis.
不能通过使旋转轴退化来实现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.