Question

Looks like I can't set face colors in a fiddle

I am setting face colors like this

var face = new THREE.Face3 (inx1, inx3, inx2);
face.color = color;
face.ambient = color;
face.normal.set(0,0,-1);
geometry.faces.push (face);

The face and normals are reversed because I am casting shadows and the shadows don't work if the face isn't set this way. But I set double side faces :

var pMaterial = new THREE.MeshPhongMaterial( {vertexColors: THREE.VertexColors, shininess: 100, side: THREE.DoubleSide } );

The end result is that the faces are black

fiddle

Exactly the same setup is working ok in local. (Well, I think that it is the same). I just can't understand what is the issue...

Was it helpful?

Solution

The version of three.js that comes "bundled" in jsfiddle is a bit too old. Try including the latest.

<script src="http://threejs.org/build/three.min.js"></script>

http://jsfiddle.net/LK84y/4/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top