I've imported a model of a soccer ball (truncated icosahedron) from blender (via JSON loader) and I wanted to change the face colors upon clicking. The faces are correctly identified I can change the color of the entire model but not particular faces. I have dug a bit deeper and I found that the colors are correctly assigned to soccerball.geometry.faces[i] but the new face colors are not shown.
I've gone through all of the similar threads and tried all of the proposed solutions (different materials, dirtyColors, dynamic, colorsNeedUpdate, etc.) but nothing helped.
this is how I import the model:
var loader = new THREE.JSONLoader( );
var onGeometry = function(geom) {
soccer = new THREE.Mesh( geom, new THREE.MeshLambertMaterial());
soccer.position.set( 0, 0, 0 );
soccer.scale.set( 2, 2, 2 );
soccer.geometry.dynamic = true;
soccer.geometry.dirty = true;
soccer.overdraw = true;
objects.push(soccer);
scene.add(soccer);
};
loader.load("models/model.js", onGeometry);
Can you please help me? thanks in advance
soccer.material.vertexColors = THREE.VertexColors ;
or
soccer.material.vertexColors = THREE.FaceColors;
If that doesn't work then I'll need to havre the model itself to do some tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With