I have a collection of points stored in a large string, with newline characters \n separating each point. Each point is saved as x y z r g b, where r g b values fall between 0 and 255.
After reading through the ThreeJS documentation, I found a way to define color using the following code:
var color = new THREE.Color("rgb(255,0,0)");
Despite this, my points appear white when displayed in my ThreeJS viewer. What mistake am I making? Here's the code snippet:
var cloud = data.split('\n');
for (var i=0; i<cloud.length; i++) {
var colour = 'rgb(' + pt[3] + ',' + pt[4] + ',' + pt[5] + ')';
model.vertices.push( new THREE.Vector3(x, y, z) );
colours.push( new THREE.Color(colour) );
}