How to use the MultiMaterial function from three

Find comprehensive JavaScript three.MultiMaterial code examples handpicked from public code repositorys.

21
22
23
24
25
26
27
28
29
30

  new THREE.MeshLambertMaterial({ color: 0x90A075 }),
  new THREE.MeshBasicMaterial({ color: 0xffffff})

];
self.mesh.material = new THREE.MultiMaterial(materials);
self.mesh.material.materials[0].skinning = true;
self.mesh.material.materials[1].skinning = true;

self.mesh.material.shading = THREE.FlatShading;
fork icon10
star icon33
watch icon0

748
749
750
751
752
753
754
755
756
		var sourceMaterial = materials[mi];
		buffergeometry.addGroup( sourceMaterial.groupStart, sourceMaterial.groupCount, mi );

	}

	var multiMaterial = new THREE.MultiMaterial( createdMaterials );
	mesh = ( ! isLine ? new THREE.Mesh( buffergeometry, multiMaterial ) : new THREE.LineSegments( buffergeometry, multiMaterial ) );

} else {
fork icon0
star icon4
watch icon2

+ 21 other calls in file

692
693
694
695
696
697
698
699
700
    let sourceMaterial = materials[mi];
    buffergeometry.addGroup(sourceMaterial.groupStart, sourceMaterial.groupCount, mi);

  }

  let multiMaterial = new THREE.MultiMaterial(createdMaterials);
  mesh = ( !isLine ? new THREE.Mesh(buffergeometry, multiMaterial) : new THREE.Line(buffergeometry, multiMaterial) );

} else {
fork icon0
star icon0
watch icon2

+ 33 other calls in file

1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
var material = first_material || new THREE.MeshLambertMaterial( { color: 0xdddddd, side: geometry.doubleSided ? THREE.DoubleSide : THREE.FrontSide } );
var geom = geometry.mesh.geometry3js;

if ( num_materials > 1 ) {

	material = new THREE.MultiMaterial( used_materials_array );
	
	for ( j = 0; j < geom.faces.length; j ++ ) {

		var face = geom.faces[ j ];
fork icon0
star icon0
watch icon2

+ 10 other calls in file

605
606
607
608
609
610
611
612
613
614

                var _sourceMaterial = materials[_mi];
                buffergeometry.addGroup(_sourceMaterial.groupStart, _sourceMaterial.groupCount, _mi);
        }

        var multiMaterial = new THREE.MultiMaterial(createdMaterials);
        mesh = !isLine ? new THREE.Mesh(buffergeometry, multiMaterial) : new THREE.Line(buffergeometry, multiMaterial);
} else {

        mesh = !isLine ? new THREE.Mesh(buffergeometry, createdMaterials[0]) : new THREE.Line(buffergeometry, createdMaterials[0]);
fork icon0
star icon0
watch icon1

+ 24 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)