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

推荐订阅源

有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
F
Full Disclosure
C
Check Point Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
博客园 - Franky
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
M
MIT News - Artificial intelligence
IT之家
IT之家
博客园 - 聂微东
L
LangChain Blog
博客园 - 司徒正美
博客园_首页
云风的 BLOG
云风的 BLOG
L
LINUX DO - 最新话题
Jina AI
Jina AI
Latest news
Latest news
L
LINUX DO - 热门话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Palo Alto Networks Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
T
Tenable Blog
爱范儿
爱范儿
T
The Exploit Database - CXSecurity.com
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
S
Securelist
F
Fortinet All Blogs
AWS News Blog
AWS News Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Latest
Security Latest
J
Java Code Geeks
T
Threatpost
The Register - Security
The Register - Security
G
Google Developers Blog
Know Your Adversary
Know Your Adversary
T
Tailwind CSS 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.