Giter Club home page Giter Club logo

touch-eases's Introduction

Touch Eases

A tox asset used to create easing chops that can be sampled. This tool is basically just a wrapper of the amazing tools easings.net and ofxAnimatable. It can be used to ease chop driven animations which is especially useful when connected to triggers and timers.

Usage

To use the eases you need to:

  1. Create a select CHOP to choose the ease. In the path set it to expression mode and type op.eases.op("NameOfTheEaseYouWant"). You can find the name of all the eases by viewing the ease COMP.
  2. You will need your tween value to be clamped between 0 and 1.
  3. Use a lookup CHOP with the tween and the ease.

Usage with a lookup chop

You can either copy and paste the component into your touch file or use the released eases.tox file available in ./release or from the release page.

Adding New Functions

To add a new function, simply edit src/scripts/easesExt.py and create the new function following the following syntax:

# function must start with capitalized "Ease"
def EaseFunctionName(self, x):
	# ... logic here
	return x # return a float

If you need a helper function do not expose it or prepend "Ease"

Custom Cubic Easing

If you just need a simple custom cubic function you can make your own by using op.eases.CubicBezier(). Create a setup as depicted below and edit the control points to the bezier through the 4 variables

Custom Bezier Example

The variables sent into the function are

CubicBezier(x, firstx, firsty, lastx, lasty, tx=1.0, ty=1.0)
"""
Implmentation taken from https://github.com/armadillu/ofxAnimatable
x: tween value
first[x,y]: first control points
last[x,y]: last control points
"""

touch-eases's People

Contributors

johnenoonan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.