如何在 iPhone 上使用 OpenGL 执行补间动画之类的操作?

发布于 2024-09-30 12:49:21 字数 413 浏览 0 评论 0原文

我对 OpenGL 和一般图形元素编程非常陌生。

目前,我有一个使用代码另一部分生成的顶点映射的纹理——这四个代表角的点每秒改变几次。在实现时,随着计时器上四个角点的改变,该图像将不稳定地“出现”在不同的位置,并且形状也不同。

我希望发生的是让对象快速移动并改变形状以占据程序给出的新点 - 我希望这种情况能够顺利发生(因此它会在这些提供的位置之间浮动/形状)。

有什么方法可以像 OpenGL 中那样进行运动/形状补间吗?如果是这样,我在哪里可以找到文档,或者更好的是示例?我很难找到或理解这种事情。

编辑:另外 - 我使用另一种方法没有问题,它不需要是 OpenGL。在核心动画中使用 BasicAnimation 可以更好地完成此操作吗?如果是这样,用于这种转变的资源在哪里?形状是四边形,但不一定是正方形或矩形,因此我需要能够指定每个角点。

I'm very new to OpenGL and programming with a graphical element in general.

Currently I have a texture that is mapped using vertices that are generated by another part of the code -- these four points that represent the corners change a few times a second. As it is implemented, this image will jerkily 'appear' in different places and shaped differently as the four corner points are altered on the timer.

What I would like to have happen is for the object to quickly move and change shape to occupy the new points given by the program -- and I would like for this to happen somewhat smoothly (so it would kind of float between these supplied positions/shapes).

Is there any way to do a kind of motion/shape tween like that in OpenGL? If so, where can I find documentation or, better yet, examples? I'm having trouble finding or understanding this kind of thing.

EDIT: ALSO - I have no problem using another method, it doesn't need to be OpenGL. Is this better done in Core Animation with BasicAnimation? If so, where are some resources for this kind of transformation? The shapes are quadrilaterals but not necessarily squares or rectangles so I would need the ability to specify each corner point.

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

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

发布评论

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

评论(1

暮倦 2024-10-07 12:49:21

OpenGL 不提供这样的设施。

生成顶点的代码部分,不能修改以平滑地过渡位置而不是突然改变它们吗?如果没有,您可以在该代码之上编写代码,并且您编写的代码通过平滑过渡来包装位置生成吗?

OpenGL provides no such facility.

The part of the code that generates the vertices, can't that be modified to smoothly transition the positions rather than abruptly changing them? If not, can you write code on top of that code, and that code you write wraps the position generation by smoothly transitioning?

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