Iphone 上的 OpenGL ES:简单的 2D 动画(插值/补间)
我正在开发一个应用程序,该应用程序基本上围绕动态绘制和动画的 2D 形状(主要是简单的多边形)进行。
我正在寻找一种轻松为动画计时的方法。它基本上只是在指定时间内将顶点移动到指定点,因此只需使用所有常用的缓动参数来插入浮动。我来自 Flash/ActionScript 3 环境,因此如果您熟悉该环境,请考虑补间类。
我可能可以轻松地使用核心动画(BasicAnimation等)来做到这一点,但我将有多达一百个具有不同不透明度的渐变填充形状动态动画, 我需要良好的性能(60fps 就很好了)。所以我选择了 OpenGL ES。另外,我完全赞成投入时间学习一些我能够跨平台重用的东西。
所以我知道 OpenGL 仅用于图形渲染,并且我不会找到任何内置的 2D 动画方法。而且我听说将 CA 与 OpenGL 一起使用(如果可行)在性能方面并不是一个好主意。 但在我深入研究插值算法以增加每一帧的顶点坐标之前,我只是想确保我没有完全错过一些更容易的事情!?
谢谢!
I'm working on an app that basically revolves around 2D shapes (mostly simple polygons) being dynamically drawn and animated.
I'm looking for a way to easily time my animations. It's basically just moving a vertex to a specified point in a specified time, so just interpolating floats, with all the usual easing parameters. I come from a Flash/ActionScript 3 environment, so if you're familiar with that, think Tween Classes.
I probably could easily be doing this with Core Animation (BasicAnimation etc), but i will have up to a hundred gradient-filled shapes with varying opacity being animated dynamically,
and I need good performance (60fps would be great). So i went for OpenGL ES. Plus I'm totally for investing time into learning something that I'll be able to reuse cross-platform.
So I know OpenGL is only for graphic rendering, and I'm not going to find any 2D animation methods built in. And I heard using CA with OpenGL (if feasible) was not a good idea performance-wise.
But before I look deeper into interpolation algorithms to increment my vertex's coordinates every frame, I juste wanted to make sure I wasn't totally missing out on something much easier!?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会研究流行的 cocos2d 库。看起来真的很不错;支持动画并在幕后使用 OpenGL ES。
I would look into the popular cocos2d library. It looks really nice; supports animation and uses OpenGL ES behind the scenes.