( v1, v2, v3, uv1, uv2, uv3, element, material )
| 15830 | } |
| 15831 | |
| 15832 | function renderFace3( v1, v2, v3, uv1, uv2, uv3, element, material ) { |
| 15833 | |
| 15834 | _this.info.render.vertices += 3; |
| 15835 | _this.info.render.faces ++; |
| 15836 | |
| 15837 | setOpacity( material.opacity ); |
| 15838 | setBlending( material.blending ); |
| 15839 | |
| 15840 | _v1x = v1.positionScreen.x; _v1y = v1.positionScreen.y; |
| 15841 | _v2x = v2.positionScreen.x; _v2y = v2.positionScreen.y; |
| 15842 | _v3x = v3.positionScreen.x; _v3y = v3.positionScreen.y; |
| 15843 | |
| 15844 | drawTriangle( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y ); |
| 15845 | |
| 15846 | if ( ( material instanceof THREE.MeshLambertMaterial || material instanceof THREE.MeshPhongMaterial ) && material.map === null ) { |
| 15847 | |
| 15848 | _diffuseColor.copy( material.color ); |
| 15849 | _emissiveColor.copy( material.emissive ); |
| 15850 | |
| 15851 | if ( material.vertexColors === THREE.FaceColors ) { |
| 15852 | |
| 15853 | _diffuseColor.multiply( element.color ); |
| 15854 | |
| 15855 | } |
| 15856 | |
| 15857 | if ( material.wireframe === false && material.shading == THREE.SmoothShading && element.vertexNormalsLength == 3 ) { |
| 15858 | |
| 15859 | _color1.copy( _ambientLight ); |
| 15860 | _color2.copy( _ambientLight ); |
| 15861 | _color3.copy( _ambientLight ); |
| 15862 | |
| 15863 | calculateLight( element.v1.positionWorld, element.vertexNormalsModel[ 0 ], _color1 ); |
| 15864 | calculateLight( element.v2.positionWorld, element.vertexNormalsModel[ 1 ], _color2 ); |
| 15865 | calculateLight( element.v3.positionWorld, element.vertexNormalsModel[ 2 ], _color3 ); |
| 15866 | |
| 15867 | _color1.multiply( _diffuseColor ).add( _emissiveColor ); |
| 15868 | _color2.multiply( _diffuseColor ).add( _emissiveColor ); |
| 15869 | _color3.multiply( _diffuseColor ).add( _emissiveColor ); |
| 15870 | _color4.addColors( _color2, _color3 ).multiplyScalar( 0.5 ); |
| 15871 | |
| 15872 | _image = getGradientTexture( _color1, _color2, _color3, _color4 ); |
| 15873 | |
| 15874 | clipImage( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, 0, 0, 1, 0, 0, 1, _image ); |
| 15875 | |
| 15876 | } else { |
| 15877 | |
| 15878 | _color.copy( _ambientLight ); |
| 15879 | |
| 15880 | calculateLight( element.centroidModel, element.normalModel, _color ); |
| 15881 | |
| 15882 | _color.multiply( _diffuseColor ).add( _emissiveColor ); |
| 15883 | |
| 15884 | material.wireframe === true |
| 15885 | ? strokePath( _color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) |
| 15886 | : fillPath( _color ); |
| 15887 | |
| 15888 | } |
| 15889 |
no test coverage detected