如何在 iPhone 上使用 openGL 实现淡出效果?
我正在使用 Apple 的 GLPaint 示例。
但我不知道如何创建一种效果,使已经绘制的东西淡出。 我在 Flash 中创建了一个示例,它显示了我正在寻找的效果: http://staging.rwichmann.com/openglexample/
在 Flash 中,我正在绘制纹理一个 BitmapData,在每一帧中,我都会向 BitmapData 添加一个 ColorTransform,从而淡出旧的绘制数据。
我想openGL中一定有类似的解决方案。与 renderBuffer
或 frameBuffer
相关的东西,但我没有找到任何解决方案。
你有什么想法、技巧、提示吗?
I'm playing around with the GLPaint Example from Apple.
But I don't know how to create an effect which fades the already drawn stuff out.
I created an example in Flash which shows the effect I'm looking for:
http://staging.rwichmann.com/openglexample/
In Flash I'm drawing a texture on a BitmapData
and in every frame I'm adding a ColorTransform to the BitmapData
which fades out the old drawn data.
I guess there must be a similar solution in openGL. Something with the renderBuffer
or frameBuffer
but I didn't find any solution.
Do you have an idea, tip, hint?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是一个建议。与代码无关,而是与艺术相关。创建一个具有递减 alpha 值的长尾随艺术,直到艺术结束时图形变得透明。根据需要旋转和缩放以匹配主要对象的转弯和方向。这可能过于简化,但也适用于 Quartz。如果您采用 3D,则必须考虑相机的渲染方向并应用一系列类似的渐变 alpha 纹理。
抱歉,没有真正的代码可以向您展示。
此致,
纳差蓬
Just a suggestion. Not really that code related, it's art related. Create a long trailing art with diminishing alpha values until at the end of the art the graphic is transparent. Rotate and scale as necessary to match the turns and directions of the lead object. This can be overly simplified but will also work with Quartz. If you go 3D you have to consider the rendering direction to the camera and apply a similar series of fading alpha textures.
sorry, no real code to show you.
Best regards,
Natchaphon