How to Use uvanimator to animate my mesh UV?

Source: Internet
Author: User
ArticleDirectory
    • How to Use uvanimator to animate my mesh UV?
How to Use uvanimator to animate my mesh UV?

Software: away3d 4.x

datouaizi, member
posted: 20 July 2012 PM total posts: 92

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

Richard Olsson, Administrator
Posted:23 July 2012 AMTotal 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 wocould not work (because you wowould 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.