0

I got this tunnel which consists of a lot of vertices. Right now I got something like a rainbow effect but I'm not happy with the colors and their brightness, so my question is how can I change the color range and the brightness or in general how can I gain access to the FaceColors.

for (i=0; i<p.length; i++) {
  var x = p[i][0];
  var y = p[i][2];
  var z = p[i][1];
  p[i] = new THREE.Vector3(x,y,z);
}

var material = new THREE.MeshLambertMaterial({
side: THREE.BackSide,
vertexColors: THREE.FaceColors,
wireframe: true



});

var hue = 0;
function col(){
    for(i=0; i<geometry.faces.length; i++){
hue++;
    geometry.faces[i].color = new THREE.Color("hsl("+hue+",100%,50%)");
  

  }
}
Mugen87
  • 28,829
  • 4
  • 27
  • 50
  • After you've updated your face colors, try setting: `geometry.needsUpdate = true;` This will trigger three.js to re-upload the information to the GPU. Without this, the GPU won't know to change. – TheJim01 Apr 03 '19 at 12:59
  • Possible duplicate of [How to change face color in Three.js](https://stackoverflow.com/questions/11252592/how-to-change-face-color-in-three-js) – Mugen87 Apr 03 '19 at 13:51

0 Answers0