ppalludan
ppalludan

Reputation: 53

Material DoubleSide - How to achieve different material on each side?

I have some generated geometries, where I want to see the faces from 2 sides.

So when looking from the front of one of the face's in the geometry, it is using material1 but viewed from the back you see material2.

I have experimentet with THREE.FrontSide, THREE.BackSide & THREE.DoubleSide, but none of them seem to give the wanted result. DoubleSide will just mirror the material on front and back.

Should I clone my geometry and create two meshes with two different materials ( mat1 = front & mat2 = back ) or what would you guys do?

Upvotes: 4

Views: 417

Answers (1)

mrdoob
mrdoob

Reputation: 19602

Yes, two meshes with different materials should do the trick:.....

var material1 = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
var material2 = new THREE.MeshBasicMaterial( { color: 0x0000ff, side: THREE.BackSide } );
var object1 = new THREE.Mesh( geometry, material1 );
var object2 = new THREE.Mesh( geometry, material2 );       

Upvotes: 2

Related Questions