Created
September 19, 2016 23:57
-
-
Save albertochiwas/e652025bdc38273b39fd0a6c6af2b232 to your computer and use it in GitHub Desktop.
Version en camara lenta con arreglos (sombra simple)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var av = new Avatar(Avatar.getName(5)); | |
var x = 140; | |
frameRate(10); | |
var nx = [0.25,3,1,-3,1,1,3.5,3,-3.5,-3]; | |
var ag = [0,-40,-90,90,-90,-30,20,-60,-20,-60]; | |
av.setLimits([ | |
[-5,5],[-40,90],[-90,5],[-40,90],[-90,5], | |
[30,90],[-60,60],[-5,80],[-60,60],[-5,80]]); | |
for (var i=0; i<av.joints(); i++) { | |
av.setNext(i,nx[i]); | |
av.setAngle(i,ag[i]); | |
} | |
av.scale(0.8); | |
var draw = function() { | |
background(0,200,0); | |
for (var i=0; i<av.joints(); i++) { | |
if ( i!==2 && i!==4 ) { | |
av.next(i); | |
} | |
} | |
fill(0,0,0,50); | |
noStroke(); | |
ellipse(x-100,340,180,20); | |
av.draw(x+=2,200+6*sin(5*x)); | |
if (x>415) { | |
noLoop(); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment