浏览代码

Merge pull request #18325 from Mugen87/dev29

Mesh/Line/Points: Always use white as default color.
Mr.doob 5 年之前
父节点
当前提交
138d25dbd1

+ 1 - 4
docs/api/en/objects/Line.html

@@ -47,12 +47,9 @@
 
 		<p>
 		[page:Geometry geometry] — vertices representing the line segment(s). Default is a new [page:BufferGeometry].<br />
-		[page:Material material] — material for the line. Default is a new [page:LineBasicMaterial] with random color.<br />
+		[page:Material material] — material for the line. Default is a new [page:LineBasicMaterial].<br />
 		</p>
 
-		<p>If no material is supplied, a randomized line material will be created and assigned to the object.</p>
-
-
 		<h2>Properties</h2>
 		<p>See the base [page:Object3D] class for common properties.</p>
 

+ 0 - 3
docs/api/en/objects/LineLoop.html

@@ -31,9 +31,6 @@
 		[page:Material material] — Material for the line. Default is [page:LineBasicMaterial LineBasicMaterial].
 		</p>
 
-		<p>If no material is supplied, a randomized line material will be created and assigned to the object.</p>
-
-
 		<h2>Properties</h2>
 		<p>See the base [page:Line] class for common properties.</p>
 

+ 0 - 3
docs/api/en/objects/LineSegments.html

@@ -30,9 +30,6 @@
 		[page:Material material] — Material for the line. Default is [page:LineBasicMaterial LineBasicMaterial].
 		</p>
 
-		<p>If no material is supplied, a randomized line material will be created and assigned to the object.</p>
-
-
 		<h2>Properties</h2>
 		<p>See the base [page:Line] class for common properties.</p>
 

+ 1 - 1
docs/api/en/objects/Mesh.html

@@ -52,7 +52,7 @@
 		<h3>[property:Material material]</h3>
 		<p>
 			An instance of material derived from the [page:Material] base class or an array of materials, defining the
-			object's appearance. Default is a [page:MeshBasicMaterial] with a random color.
+			object's appearance. Default is a [page:MeshBasicMaterial].
 		</p>
 
 		<h3>[property:Array morphTargetInfluences]</h3>

+ 2 - 3
docs/api/en/objects/Points.html

@@ -25,8 +25,7 @@
 		<p>
 			[page:Geometry geometry] — (optional) an instance of [page:Geometry] or [page:BufferGeometry].
 				Default is a new [page:BufferGeometry].<br />
-			[page:Material material] — (optional) a [page:Material]. Default is a new [page:PointsMaterial]
-				with a random color.
+			[page:Material material] — (optional) a [page:Material]. Default is a new [page:PointsMaterial].
 		</p>
 
 
@@ -44,7 +43,7 @@
 		<h3>[property:Material material]</h3>
 		<p>
 			An instance of [page:Material], defining the object's appearance.
-			Default is a [page:PointsMaterial] with a random color.
+			Default is a [page:PointsMaterial].
 		</p>
 
 		<h3>[property:Array morphTargetInfluences]</h3>

+ 0 - 3
docs/api/zh/objects/Line.html

@@ -47,9 +47,6 @@
 		[page:Material material] —— 线的材质,默认值是一个新的具有随机颜色的[page:LineBasicMaterial]。<br />
 		</p>
 
-		<p>如果没有指定材质,一个随机颜色的线的材质将会被创建,并应用到该物体上。</p>
-
-
 		<h2>属性</h2>
 		<p>共有属性请参见其基类[page:Object3D]。</p>
 

+ 0 - 3
docs/api/zh/objects/LineLoop.html

@@ -29,9 +29,6 @@
 		[page:Material material] —— 线的材质,默认值是[page:LineBasicMaterial LineBasicMaterial]。
 		</p>
 
-		<p>如果没有指定材质,一个随机颜色的线的材质将会被创建,并应用到该物体上。</p>
-
-
 		<h2>属性</h2>
 		<p>共有属性请参见其基类[page:Line]。</p>
 

+ 0 - 3
docs/api/zh/objects/LineSegments.html

@@ -28,9 +28,6 @@
 		[page:Material material] —— 线的材质,默认值是[page:LineBasicMaterial LineBasicMaterial]。
 		</p>
 
-		<p>如果没有指定材质,一个随机颜色的线的材质将会被创建,并应用到该物体上。</p>
-
-
 		<h2>属性</h2>
 		<p>共有属性请参见其基类[page:Line]。</p>
 

+ 4 - 2
examples/webgl_interactive_lines.html

@@ -94,13 +94,15 @@
 
 					var object;
 
+					var lineMaterial = new THREE.LineBasicMaterial( { color: Math.random() * 0xffffff } );
+
 					if ( Math.random() > 0.5 ) {
 
-						object = new THREE.Line( lineGeometry );
+						object = new THREE.Line( lineGeometry, lineMaterial );
 
 					} else {
 
-						object = new THREE.LineSegments( lineGeometry );
+						object = new THREE.LineSegments( lineGeometry, lineMaterial );
 
 					}
 

+ 1 - 1
src/objects/Line.js

@@ -30,7 +30,7 @@ function Line( geometry, material, mode ) {
 	this.type = 'Line';
 
 	this.geometry = geometry !== undefined ? geometry : new BufferGeometry();
-	this.material = material !== undefined ? material : new LineBasicMaterial( { color: Math.random() * 0xffffff } );
+	this.material = material !== undefined ? material : new LineBasicMaterial();
 
 }
 

+ 1 - 1
src/objects/Mesh.js

@@ -47,7 +47,7 @@ function Mesh( geometry, material ) {
 	this.type = 'Mesh';
 
 	this.geometry = geometry !== undefined ? geometry : new BufferGeometry();
-	this.material = material !== undefined ? material : new MeshBasicMaterial( { color: Math.random() * 0xffffff } );
+	this.material = material !== undefined ? material : new MeshBasicMaterial();
 
 	this.updateMorphTargets();
 

+ 1 - 1
src/objects/Points.js

@@ -22,7 +22,7 @@ function Points( geometry, material ) {
 	this.type = 'Points';
 
 	this.geometry = geometry !== undefined ? geometry : new BufferGeometry();
-	this.material = material !== undefined ? material : new PointsMaterial( { color: Math.random() * 0xffffff } );
+	this.material = material !== undefined ? material : new PointsMaterial();
 
 	this.updateMorphTargets();