lundi 2 février 2015

Making a 3d Earth, made up of particles with Three.js


I am trying to replicate this effect: http://www.hys-inc.jp/ The only difference is that I want the particles to be positioned in such a way, that they resemble the Earth - a 'textured face' if you will.


Browsing through their code, this is what they use to set up the particles group:



var map = THREE.ImageUtils.loadTexture('/admin/wp-content/themes/hys/assets/img/particle.png');

var m = new THREE.ParticleSystemMaterial({
color: 0x000000,
size: 1.5,
map: map,
//blending: THREE.AdditiveBlending,
depthTest: false,
transparent: true
});

var p = new THREE.ParticleSystem(g, m);
scene.add(p);


This is all great, but how do I position them along a sphere to resemble the planet? I know how to do it in 2d rendering context, using a picture and pixels scanning to get the right coordinates for the particles' position, but I am clueless how to do it in 3d...


Any help is more then welcome





Aucun commentaire:

Enregistrer un commentaire