glPushMatrix();
... // Rotation?
drawObject();
glPopMatrix();
函数drawObject()
绘制一个以原点为中心、指向正x轴的对象。
如何旋转对象使其指向(x,y,z)
方向
发布于 2013-12-10 09:02:18
我自己解决了:
glRotatef(atan2(z,x) * 180 / M_PI,0,1,0);
glRotatef(asin(y) * 180 / M_PI,0,0,1);
https://stackoverflow.com/questions/20483685
复制相似问题