three.js - Three js particle system with mouse interaction -


i try change behaviour particles example: http://threejs.org/examples/#webgl_particles_random

to more this: http://minimal.be/lab/flugl/

now when change fragment of code:

            ( = 0; < scene.children.length; ++ ) {                  var object = scene.children[ ];                  if ( object instanceof three.particlesystem ) {                      object.rotation.z = time * ( < 4 ? + 1 : - ( + 1 ) );                  }              } 

into that:

            ( = 0; < scene.children.length; ++ ) {                  var object = scene.children[ ];                  if ( object instanceof three.particlesystem ) {                      object.position.x = mousex;                     object.position.y = -mousey;                 }             } 

all particles move globally without change distance , velocity. change, present example. how modify code, avoid global changes in move particles? have change in shaders? or particle system in three.js enough create mouse attractor behaviour?


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -