提交 713cdf94 编写于 作者: M Mr.doob

Removed Face4 out of other renderers.

上级 74b9c22d
......@@ -172,33 +172,6 @@ THREE.SVGRenderer = function () {
}
} else if ( element instanceof THREE.RenderableFace4 ) {
_v1 = element.v1; _v2 = element.v2; _v3 = element.v3; _v4 = element.v4;
if ( _v1.positionScreen.z < -1 || _v1.positionScreen.z > 1 ) continue;
if ( _v2.positionScreen.z < -1 || _v2.positionScreen.z > 1 ) continue;
if ( _v3.positionScreen.z < -1 || _v3.positionScreen.z > 1 ) continue;
if ( _v4.positionScreen.z < -1 || _v4.positionScreen.z > 1 ) continue;
_v1.positionScreen.x *= _svgWidthHalf; _v1.positionScreen.y *= -_svgHeightHalf;
_v2.positionScreen.x *= _svgWidthHalf; _v2.positionScreen.y *= -_svgHeightHalf;
_v3.positionScreen.x *= _svgWidthHalf; _v3.positionScreen.y *= -_svgHeightHalf;
_v4.positionScreen.x *= _svgWidthHalf; _v4.positionScreen.y *= -_svgHeightHalf;
_elemBox.setFromPoints( [
_v1.positionScreen,
_v2.positionScreen,
_v3.positionScreen,
_v4.positionScreen
] );
if ( _clipBox.isIntersectionBox( _elemBox ) === true ) {
renderFace4( _v1, _v2, _v3, _v4, element, material );
}
}
}
......@@ -394,67 +367,6 @@ THREE.SVGRenderer = function () {
}
function renderFace4( v1, v2, v3, v4, element, material ) {
_this.info.render.vertices += 4;
_this.info.render.faces ++;
_svgNode = getPathNode( _pathCount ++ );
_svgNode.setAttribute( 'd', 'M ' + v1.positionScreen.x + ' ' + v1.positionScreen.y + ' L ' + v2.positionScreen.x + ' ' + v2.positionScreen.y + ' L ' + v3.positionScreen.x + ',' + v3.positionScreen.y + ' L ' + v4.positionScreen.x + ',' + v4.positionScreen.y + 'z' );
if ( material instanceof THREE.MeshBasicMaterial ) {
_color.copy( material.color );
if ( material.vertexColors === THREE.FaceColors ) {
_color.multiply( element.color );
}
} else if ( material instanceof THREE.MeshLambertMaterial || material instanceof THREE.MeshPhongMaterial ) {
_diffuseColor.copy( material.color );
if ( material.vertexColors === THREE.FaceColors ) {
_diffuseColor.multiply( element.color );
}
_color.copy( _ambientLight );
calculateLight( _lights, element.centroidModel, element.normalModel, _color );
_color.multiply( _diffuseColor ).add( material.emissive );
} else if ( material instanceof THREE.MeshDepthMaterial ) {
_w = 1 - ( material.__2near / (material.__farPlusNear - element.z * material.__farMinusNear) );
_color.setRGB( _w, _w, _w );
} else if ( material instanceof THREE.MeshNormalMaterial ) {
var normal = element.normalModelView;
_color.setRGB( normal.x, normal.y, normal.z ).multiplyScalar( 0.5 ).addScalar( 0.5 );
}
if ( material.wireframe ) {
_svgNode.setAttribute( 'style', 'fill: none; stroke: ' + _color.getStyle() + '; stroke-width: ' + material.wireframeLinewidth + '; stroke-opacity: ' + material.opacity + '; stroke-linecap: ' + material.wireframeLinecap + '; stroke-linejoin: ' + material.wireframeLinejoin );
} else {
_svgNode.setAttribute( 'style', 'fill: ' + _color.getStyle() + '; fill-opacity: ' + material.opacity );
}
_svg.appendChild( _svgNode );
}
function getLineNode( id ) {
if ( _svgLinePool[ id ] == null ) {
......
......@@ -134,22 +134,6 @@ THREE.SoftwareRenderer = function () {
shader, element, material
)
} else if ( element instanceof THREE.RenderableFace4 ) {
drawTriangle(
element.v1.positionScreen,
element.v2.positionScreen,
element.v4.positionScreen,
shader, element, material
);
drawTriangle(
element.v2.positionScreen,
element.v3.positionScreen,
element.v4.positionScreen,
shader, element, material
);
}
}
......
......@@ -143,28 +143,6 @@ THREE.WebGLRenderer3 = function ( parameters ) {
}
if ( face instanceof THREE.Face4 ) {
addPosition( vertices[ face.a ] );
addPosition( vertices[ face.c ] );
addPosition( vertices[ face.d ] );
if ( vertexNormals === true ) {
addNormal( face.vertexNormals[ 0 ] );
addNormal( face.vertexNormals[ 2 ] );
addNormal( face.vertexNormals[ 3 ] );
} else {
addNormal( face.normal );
addNormal( face.normal );
addNormal( face.normal );
}
}
}
var buffer = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册