How to use the FlatShading function from three

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

83
84
85
86
87
88
89
90
91
92
			this.dimension.depth / 2
		)
	);
	this.material = new THREE.MeshToonMaterial({
		color: this.color,
		shading: THREE.FlatShading
	});
	this.mesh = new THREE.Mesh(geometry, this.material);
	this.mesh.position.set(this.position.x, this.position.y, this.position.z);
}
fork icon147
star icon53
watch icon0

25
26
27
28
29
30
31
32
33
34
];
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;

self.add(self.mesh);
Events.on('updateScene', self.update.bind(self));
Events.on('stageChanged', self.stageChanged.bind(self));
fork icon10
star icon33
watch icon0

29
30
31
32
33
34
35
36
37
38
objectLoader.load('models/ground.json', function (obj) {
  obj.children.forEach(function (value) {
    if (value instanceof THREE.Mesh) {
      value.geometry.computeFaceNormals();
      value.geometry.computeVertexNormals();
      value.material.shading = THREE.FlatShading;
      switch (value.name) {
        case 'world':
          self.worldFar = value;
          break;
fork icon10
star icon33
watch icon10

+ 3 other calls in file

26
27
28
29
30
31
32
33
34
    color : 0xccccbb,
    // color : 0xff,
    roughness : 0,
    metalness : 0,
    transparent : true,
    shading : THREE.FlatShading
    // wireframe : true
});
mat.skinning = true;
fork icon1
star icon4
watch icon2

Other functions in three

Sorted by popularity

function icon

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