Jump to content
Search Community

Anti-smooth easing (AS3)

protoemocional test
Moderator Tag

Recommended Posts

This question might sound stupid, considering the very function intended for TweenLite/Max.

 

How can I make any kind of stuttered movement, still using TweenLite/Max?

 

What I mean is, I don't want to make smooth tweens, but glitched and rough ones. Since I'm not goot at math, I have no idea how to design an easing equation for this (think of a sawtooth wave). Can anyone point me out on the right track? Easing eqautions visualizer? Other tools?

 

Thanks a lot!

Link to comment
Share on other sites

Interesting challenge. I spent some time creating something that hopefully gives you exactly what you asked for. It's a new easing class called "RoughEase" and it allows you to control a bunch of parameters to get the effect you're after. For example, you can define a templateEase (Linear.easeNone by default) that it'll use as the basis for the ease, and set the "variance" to control how far the random points are allowed to stray from the templateEase. The "points" parameter controls how many random points are placed (the more points the more frequent the flickers/jumps). Take a peek at the attached zip and let me know if it's what you were hoping for. There's ASDoc comments in place with a couple of simple code examples at the top. I'll probably post this on the blog at some point soon, but if you or anyone has any suggestions, feel free to post 'em here.

Link to comment
Share on other sites

Hey Greensock,

 

It is indeed an interesting and rare challenge. Unfortunately, I did not find your new easing class approaching the kind of roughness I needed. Here are some ideas that you could apply, since I'm a no-brainer in scripting:

 

- Above all, the roughness on the tween should be based on the on both coordinates (x,y). If the path is diagonal, throw some trigonometry there. I'm thinking about emulating sound wave algorithms for the tween: a triangular wave, a sinewave, a sinusoid. Check them out, they are the best way to bring that stuttering, glitchy feeling. I did post a day ago my very own function to apply to a custom Bezier. Unfortunately, I'm afraid my scripting skills don't allow me to do much with it, it may need serious improvements. It works more fluid than squarely, since it's based on Bezier, but it may be worth checking out. Look for "custom Bezier triangular function" or something, it's still on the first page of the forum.

 

- In the case that the tween is just horizontal or vertical, with no diagonals, I advise you to focus on the coordinate opposite to movement: If you're moving on the x-axis, the y-axis should become more affected. Otherwise, the sensation is more like a drunken, squared bezier curve. It may be useful but it doesn't give the sense of movement in that way.

 

- Optimization, bitwise operators, better random functions than the Adobe preset.

 

I am using your function though, and thank you for posting the code. Maybe I'm doing something wrong? I'd like to move the MovieClip on the y-axis when moving along x-axis, but I can't find a way to do so...

 

Goodbye....

 

-

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...