浏览代码

Examples: Correct check for vertexColors.

Mugen87 5 年之前
父节点
当前提交
4611d4e3f7

+ 3 - 3
examples/js/renderers/Projector.js

@@ -266,7 +266,7 @@ THREE.Projector = function () {
 
 				_line.material = object.material;
 
-				if ( object.material.vertexColors === true ) {
+				if ( object.material.vertexColors ) {
 
 					_line.vertexColors[ 0 ].fromArray( colors, a * 3 );
 					_line.vertexColors[ 1 ].fromArray( colors, b * 3 );
@@ -320,7 +320,7 @@ THREE.Projector = function () {
 
 				_face.material = material;
 
-				if ( material.vertexColors === true ) {
+				if ( material.vertexColors ) {
 
 					_face.color.fromArray( colors, a * 3 );
 
@@ -830,7 +830,7 @@ THREE.Projector = function () {
 
 							_line.material = object.material;
 
-							if ( object.material.vertexColors === true ) {
+							if ( object.material.vertexColors ) {
 
 								_line.vertexColors[ 0 ].copy( object.geometry.colors[ v ] );
 								_line.vertexColors[ 1 ].copy( object.geometry.colors[ v - 1 ] );

+ 2 - 2
examples/js/renderers/SVGRenderer.js

@@ -401,7 +401,7 @@ THREE.SVGRenderer = function () {
 
 			_color.copy( material.color );
 
-			if ( material.vertexColors === true ) {
+			if ( material.vertexColors ) {
 
 				_color.multiply( element.color );
 
@@ -411,7 +411,7 @@ THREE.SVGRenderer = function () {
 
 			_diffuseColor.copy( material.color );
 
-			if ( material.vertexColors === true ) {
+			if ( material.vertexColors ) {
 
 				_diffuseColor.multiply( element.color );
 

+ 3 - 3
examples/jsm/renderers/Projector.js

@@ -288,7 +288,7 @@ var Projector = function () {
 
 				_line.material = object.material;
 
-				if ( object.material.vertexColors === true ) {
+				if ( object.material.vertexColors ) {
 
 					_line.vertexColors[ 0 ].fromArray( colors, a * 3 );
 					_line.vertexColors[ 1 ].fromArray( colors, b * 3 );
@@ -342,7 +342,7 @@ var Projector = function () {
 
 				_face.material = material;
 
-				if ( material.vertexColors === true ) {
+				if ( material.vertexColors ) {
 
 					_face.color.fromArray( colors, a * 3 );
 
@@ -852,7 +852,7 @@ var Projector = function () {
 
 							_line.material = object.material;
 
-							if ( object.material.vertexColors === true ) {
+							if ( object.material.vertexColors ) {
 
 								_line.vertexColors[ 0 ].copy( object.geometry.colors[ v ] );
 								_line.vertexColors[ 1 ].copy( object.geometry.colors[ v - 1 ] );

+ 2 - 2
examples/jsm/renderers/SVGRenderer.js

@@ -415,7 +415,7 @@ var SVGRenderer = function () {
 
 			_color.copy( material.color );
 
-			if ( material.vertexColors === true ) {
+			if ( material.vertexColors ) {
 
 				_color.multiply( element.color );
 
@@ -425,7 +425,7 @@ var SVGRenderer = function () {
 
 			_diffuseColor.copy( material.color );
 
-			if ( material.vertexColors === true ) {
+			if ( material.vertexColors ) {
 
 				_diffuseColor.multiply( element.color );