I am attempting to reproduce a specific effect showcased in the following link:
In my current project, I have multiple cubes positioned in 3D space along the x and z axis with loops. However, I am struggling to animate them in a precise order. My idea is to loop through the cubes and scale each one along its Y axis with different timing based on its position.
Furthermore, I believe I should utilize setInterval() to trigger the animation sequence, but I am unsure how to implement it...
Below is the code snippet I am using to loop through the boxes and perform scaling:
var r = -1;
(function f(){
r = (r + 1) % cubes.length;
cubes[r].scale.y += cubes[r].vy;
if (cubes[r].scale.y >= 1.4) {
cubes[r].vy *= -1;
}
setInterval(f, 200);
However, this code does not achieve the desired wavy, step-by-step scaling effect...
For reference, here is a link to the current version of my project: http://codepen.io/gbnikolov/pen/NPGqqq