惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园_首页
V
Visual Studio Blog
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
博客园 - 【当耐特】
MyScale Blog
MyScale Blog
月光博客
月光博客

博客园 - David Fan

JigLib类简介 3DS 文件格式 AGAL2 顶点着色器&像素着色器 AGAL OBJ文件格式 md5mesh&md5anim 矩阵、欧拉角、轴-角对、四元数随笔 Box2D&Away3D结合的例子 光照模型 仿照实现的away3d4示例应用 利用away3d,jiglibflash在android实现的投骰子 虚拟手柄控制的小车 air3.4 Android IPones4s 下运行正常 实现了一个简单的AS3 MVC框架,希望对大家有所帮助! 负责的一个项目上线了,还有Flex捐给apache是好事! 转-flex自定义组件 ExternalInterface在Flex Project中C#,C++通信使用上的不同 - David Fan vs2008beta2 javascript 智能感知,语法着色不工作。付解决办法。 我正在读和已经读过的书(随时更新心得,欢迎交流)
how to use UVAnimator to animate my mesh uv?
David Fan · 2012-11-15 · via 博客园 - David Fan

how to use UVAnimator to animate my mesh uv?

Software: Away3D 4.x


datouaizi, Member
Posted: 20 July 2012 02:44 PM   Total Posts: 92 

I want my mesh uv animate ,hard to find example.

   

Richard Olsson, Administrator
Posted: 23 July 2012 07:59 AM   Total Posts: 1190   # 1 ] 

First of all, note that UV animation is a way to animate UV transforms through interpolating between a set of keyframes. They’re great for creating streams of water, for example, but if you’re looking to create spritesheet animation you will need to implement a very basic UV transform update code of your own. Interpolating between frame states in spritesheet animation would not work (because you would sometimes end up right between two frame sprites.)

That said, here’s a basic rundown of how you create and use UV animation:

Create UV frames (UVAnimationFrame) representing the various keyframe states in your animation. Set their offsetU, offsetV, scaleU, scaleV and rotation properties.

Create a UVClipNode and add your frames to it using addFrame(), passing in the frame object and the duration. The UVClipNode basically represents a “pre-recorded” UV animation with keyframes.

Create a UVAnimationState, passing in your UVClipNode instance as the root node argument to the constructor. The animation state represents the current state of the animation, which is constructed for any set of nodes. In this case, the clip node will “feed” the current state with the UV transformation matrix to be used to perform the UV transformation of the current (interpolation of) frames.

Next create an instance of UVAnimationSet, and add your state to it using the addState() method. While invoking that method, also give your state a name by passing it into the name argument. For example, call it “myanim”.

Finally, create a UVAnimator, and pass in the animation set. Assign the animator to the Mesh.animator and invoke animator.play(“myanim”) to play the animation you created.