在OpenGL ES,android平台中旋转对象
我在android平台上的openGL ES中画了一个正方形,我只是想让它旋转几次的印象,并且我想在旋转时看到正方形。
for(float i=0;i<1000;i++){
gl.glRotatef(40f, -1.0f, 0.0f, 0.0f);
Thread.sleep(100); // put the thread to sleep for 1 sex
}
但它不能正常工作,只能让它旋转一圈。
我做错了什么?
I have drawn a square in openGL
ES on android platform , i just want to make the impression of it rotating for several times and i want to see the square while rotating.
for(float i=0;i<1000;i++){
gl.glRotatef(40f, -1.0f, 0.0f, 0.0f);
Thread.sleep(100); // put the thread to sleep for 1 sex
}
But its not working properly , in only make it rotate one .
what am I doing wrong ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的绘画习惯在哪里?如果您只是迭代一千次来应用旋转,但实际上并没有绘制,那么您将永远看不到旋转的效果。
Where is your drawing routine? If you just itereate a thousand times to apply rotation, but aren't actually drawing, you'll never see the rotation in effect.
您需要将 gl.flush() 缓冲区放入屏幕中。
另外为什么你在 for 中使用浮点数?
you need to gl.flush() the buffer into the screen.
Also why are you using a float in a for ?