Epic Jefferson

27 Jan 2015

This is a mashup of 2 anitype characters that I enjoyed. It kind of looks like a person reaching for a hug.

Here is a link to my character
http://www.anitype.com/entry/agtzfmFuaXR5cGVjb3IUCxIHbGV0dGVycxiAgIDA-rDCCgw/

[iframe src=”http://www.anitype.com/entry/agtzfmFuaXR5cGVjb3IUCxIHbGV0dGVycxiAgIDA-rDCCgw/” width=”620″ height=”360″]

/**
 * Register your submission and choose a character
 * For more information check out the documentation
 * http://anitype.com/documentation
 */
Anitype.register('*', {

 // Enter your name
 author: 'Epic Jefferson',

 // Enter a kickback website, must have http
 website: 'http://www.epicjefferson.com/',

 // Make your animation here
 construct: function(two, points) {

 // Reference to instance
 var anitype = this;

 
 var polygon = anitype.makePolygon(points).subdivide();
 var dimensions = polygon.getBoundingClientRect();
 var angleStep = (Math.PI * 2 / polygon.vertices.length);
 
 _.each(polygon.vertices, function(vert, i){
 var time = { value:0 };
 vert.oX = vert.x;
 vert.oAngle = Math.sin((vert.x / dimensions.width / 2) + (i*angleStep));
 anitype.addTween(time, {
 to: { value: 1 },
 easing: Anitype.Easing.Linear.None,
 duration: 1,
 start: 0,
 update: function() {
 var angle = vert.oAngle + (this.value * Math.PI * 2);
 vert.x = Math.cos(angle) * vert.oX;
 }
 });
 });

 return two.makeGroup(polygon);
 }

});