javascript - particle.subSelf() Undefined is not a function -
i trying give velocity , origin particle threes cant add origin
function getorigin() { return new three.vector3(weapon.vehicle.position.x, weapon.vehicle.position.y, weapon.vehicle.position.z); } function start() { time = weapon.time; done = false; var origin = getorigin(); particles = new three.geometry(); var pmaterial = new three.particlebasicmaterial({ color: weapon.explosion.color, size: weapon.explosion.size, map: three.imageutils.loadtexture("img/particula.png"), blending: three.additiveblending, transparent: true }); for(var p = 0; p < particlecount; p++) { // create particle random // position values, -250 -> 250 var px = (math.random() * weapon.vehicle.size.x) - (weapon.vehicle.size.x / 2), py = (math.random() * weapon.vehicle.size.y) - (weapon.vehicle.size.y / 2), pz = (math.random() * weapon.vehicle.size.z) - (weapon.vehicle.size.z / 2), particle = new three.vector3(px, py, pz); // create velocity vector particle.velocity = particle.clone(); particle.addself(origin); // add geometry particles.vertices.push(particle); } // create particle system particlesystem = new three.particlesystem(particles, pmaterial); particlesystem.sortparticles = true; scene.add(particlesystem); }
particle.addself(origin); line gives me undefined function working fine older version of threes wanted upgrade r52 r67 , finding lots of issues please if have idea appreciated.
you can find migration notes here: https://github.com/mrdoob/three.js/wiki/migration , release notes here: https://github.com/mrdoob/three.js/releases
Comments
Post a Comment