Friday, 20 January 2017

(Year 3 Sem C) Week 11 Tween js in Three js

Today, I decided to make the particles tween when it was clicked. Therefore, below is the coding that I apply which:

function onDocumentMouseClick(){
animatemove();
console.log ('you clicked me');
}

function animatemove(){

    sphere.position.x += 10;
sphere.position.y += 5;

sphere2.position.x += 90;
sphere2.position.y += 15;

    sphere3.position.x += -50;
sphere3.position.y += 5;

sphere4.position.x += -20;
sphere4.position.y += 5;

    sphere5.position.x += -10;
sphere5.position.y += 5;
    console.log ('you clicked me ');
render();
// requestAnimationFrame( animatemove );

}


The particles will move to another place when it was clicked. But, it not really  click and tween and just a simple click particle. Therefore, I have look through some tween tutorials and continue work on it. Since the particles can be clicked, i just need to solve the tween problem from now. 


No comments:

Post a Comment