How to use the FlatShading function from three
Find comprehensive JavaScript three.FlatShading code examples handpicked from public code repositorys.
GitHub: whos-evan/kazwire
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); }
147
53
0
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));
10
33
0
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;
10
33
10
+ 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;
1
4
2
three.Vector3 is the most popular function in three (22341 examples)