|
@@ -26,6 +26,7 @@ THREE.SVGRenderer = function () {
|
|
|
|
|
|
_w, // z-buffer to w-buffer
|
|
|
_vector3 = new THREE.Vector3(), // Needed for PointLight
|
|
|
+ _centroid = new THREE.Vector3(),
|
|
|
|
|
|
_svgPathPool = [], _svgLinePool = [], _svgRectPool = [],
|
|
|
_svgNode, _pathCount = 0, _lineCount = 0, _rectCount = 0,
|
|
@@ -96,7 +97,7 @@ THREE.SVGRenderer = function () {
|
|
|
|
|
|
}
|
|
|
|
|
|
- _svg.style.backgroundColor = "#" + _clearColor.getHexString();
|
|
|
+ _svg.style.backgroundColor = _clearColor.getStyle();
|
|
|
|
|
|
};
|
|
|
|
|
@@ -125,7 +126,7 @@ THREE.SVGRenderer = function () {
|
|
|
var element = _elements[ e ];
|
|
|
var material = element.material;
|
|
|
|
|
|
- if ( material === undefined || material.visible === false ) continue;
|
|
|
+ if ( material === undefined || material.opacity === 0 ) continue;
|
|
|
|
|
|
_elemBox.makeEmpty();
|
|
|
|
|
@@ -332,7 +333,9 @@ THREE.SVGRenderer = function () {
|
|
|
|
|
|
_color.copy( _ambientLight );
|
|
|
|
|
|
- calculateLight( _lights, element.centroidModel, element.normalModel, _color );
|
|
|
+ _centroid.copy( v1.positionWorld ).add( v2.positionWorld ).add( v3.positionWorld ).divideScalar( 3 );
|
|
|
+
|
|
|
+ calculateLight( _lights, _centroid, element.normalModel, _color );
|
|
|
|
|
|
_color.multiply( _diffuseColor ).add( material.emissive );
|
|
|
|