如何在openGL中旋转特定的对象? [英] How to rotate a specific object in openGL?
本文介绍了如何在openGL中旋转特定的对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在屏幕上有一些物体,只想旋转其中的一个。我尝试使用glRotatef(...)函数,但事实证明glRotatef(...)旋转我的所有对象(旋转相机,也许?)。
我怎样才能只旋转一个?
I have some objects on the screen and would like to rotate only one of them. I tried using the glRotatef(...) function but turns out glRotatef(...) rotates all my objects (rotates the camera, maybe?). How can I rotate only one?
我使用openGL ES 1.1
I use openGL ES 1.1
推荐答案
... draw stuff ...
glPushMatrix();
glRotatef(angle, 0, 1, 0);
... draw rotated stuff ...
glPopMatrix();
... draw more stuff ...
这篇关于如何在openGL中旋转特定的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文