I am using the Three.js library to render colored particles. I am iterating over the data and trying to set the color using RGB values.
particle = new THREE.Particle( new THREE.ParticleCanvasMaterial({ color:new THREE.Color().setRGB(j[0],j[1],j[2]), program: particleRender }));
sample values in the array are
139 123 124
118 115 122
163 160 177
I've also tried the following
particle = new THREE.Particle( new THREE.ParticleCanvasMaterial({ program: particleRender }));
particle.material.color.r =j[0];
particle.material.color.g =j[1];
particle.material.color.b =j[2];
But this doesn't seem to color the points. Or sometimes I occassionally see one point that is colored. What am I doing wrong here? I feel I am missing something small and silly.