粒子动画太慢

发布于 2024-09-14 07:42:16 字数 388 浏览 5 评论 0原文

我试图在我们触摸和移动时绘制几个粒子。当用户倾斜设备时,粒子会移动到倾斜的一侧。 我通过使用每个图像视图上的每个粒子来完成此步骤。但当查看 100 个图像时,速度太慢了。

SoilView= [[UIImageView alloc] initWithFrame:CGRectMake(currentPoint.x + randomDist1, CurrentPoint.y + randomDist2, 30, 30)];

[SoilView setImage:SoilImage];

所以我尝试将其更改为粒子动画,但效果不佳。大多数粒子动画样本只是爆炸或散落各处。所以我找不到编写代码的方法。
有没有办法让每个粒子像每个视图一样工作?
我该如何解决这个问题?有人可以帮我吗?

I'm trying to draw several particles as we touch and moving. When user tilts the device, particles moves to the tilted side.
I made this steps by using each particles on each Image View. But it's too slow when making like 100 image views.

SoilView= [[UIImageView alloc] initWithFrame:CGRectMake(currentPoint.x + randomDist1, CurrentPoint.y + randomDist2, 30, 30)];

[SoilView setImage:SoilImage];

so I tried to change this to particle animation, but it was not working well. most particle animation sample was just blowing up or scatters everywhere. so I couldn't find a way to make my code.
Is there any ways to make each particles to work like each views?
How can I solve this problem? Could Someone please help me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

放我走吧 2024-09-21 07:42:16

我会使用 OpenGL 来制作粒子动画。要开始使用,请查看此粒子生成器 以及 OpenGL ES 博客文章项目的作者http://iphonedevelopment。 blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html

I would use OpenGL for particle animations. To get you started take a look at this particle Generator and the OpenGL ES Blog posts of the project's author http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html

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