在OpenGL ES,android平台中旋转对象

发布于 2024-11-16 08:13:09 字数 266 浏览 5 评论 0原文

我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

把回忆走一遍 2024-11-23 08:13:09

你的绘画习惯在哪里?如果您只是迭代一千次来应用旋转,但实际上并没有绘制,那么您将永远看不到旋转的效果。

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.

雪落纷纷 2024-11-23 08:13:09

您需要将 gl.flush() 缓冲区放入屏幕中。

另外为什么你在 for 中使用浮点数?

you need to gl.flush() the buffer into the screen.

Also why are you using a float in a for ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文