You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							95 lines
						
					
					
						
							3.1 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							95 lines
						
					
					
						
							3.1 KiB
						
					
					
				
								<!DOCTYPE html>
							 | 
						|
								<html lang="zh">
							 | 
						|
									<head>
							 | 
						|
										<meta charset="utf-8" />
							 | 
						|
										<base href="../../../" />
							 | 
						|
										<script src="page.js"></script>
							 | 
						|
										<link type="text/css" rel="stylesheet" href="page.css" />
							 | 
						|
									</head>
							 | 
						|
									<body>
							 | 
						|
										[page:Material] →
							 | 
						|
								
							 | 
						|
										<h1>点精灵材质([name])</h1>
							 | 
						|
								
							 | 
						|
										<p class="desc">一种使用[page:Sprite]的材质。</p>
							 | 
						|
								
							 | 
						|
										<h2>代码示例</h2>
							 | 
						|
								
							 | 
						|
										<code>
							 | 
						|
										const map = new THREE.TextureLoader().load( 'textures/sprite.png' );
							 | 
						|
										const material = new THREE.SpriteMaterial( { map: map, color: 0xffffff } );
							 | 
						|
								
							 | 
						|
										const sprite = new THREE.Sprite( material );
							 | 
						|
										sprite.scale.set(200, 200, 1)
							 | 
						|
										scene.add( sprite );
							 | 
						|
										</code>
							 | 
						|
								
							 | 
						|
										<h2>例子</h2>
							 | 
						|
										<p>
							 | 
						|
											[example:webgl_raycaster_sprite WebGL / raycast / sprite]<br />
							 | 
						|
											[example:webgl_sprites WebGL / sprites]<br />
							 | 
						|
											[example:svg_sandbox SVG / sandbox]
							 | 
						|
										</p>
							 | 
						|
								
							 | 
						|
										<h2>构造函数(Constructor)</h2>
							 | 
						|
								
							 | 
						|
										<h3>[name]( [param:Object parameters] )</h3>
							 | 
						|
										<p>
							 | 
						|
											[page:Object parameters] - (可选)用于定义材质外观的对象,具有一个或多个属性。
							 | 
						|
											材质的任何属性都可以从此处传入(包括从[page:Material] 和 [page:ShaderMaterial]继承的任何属性)。<br /><br />
							 | 
						|
								
							 | 
						|
											属性[page:Hexadecimal color]例外,其可以作为十六进制字符串传递,默认情况下为 *0xffffff*(白色),
							 | 
						|
											内部调用[page:Color.set](color)。
							 | 
						|
											SpriteMaterials不会被[page:Material.clippingPlanes]裁剪。
							 | 
						|
										</p>
							 | 
						|
								
							 | 
						|
								
							 | 
						|
										<h2>属性(Properties)</h2>
							 | 
						|
										<p>共有属性请参见其基类[page:Material]。</p>
							 | 
						|
								
							 | 
						|
										<h3>[property:Texture alphaMap]</h3>
							 | 
						|
										<p>alpha贴图是一张灰度纹理,用于控制整个表面的不透明度。(黑色:完全透明;白色:完全不透明)。
							 | 
						|
											默认值为null。<br /><br />
							 | 
						|
								
							 | 
						|
											仅使用纹理的颜色,忽略alpha通道(如果存在)。
							 | 
						|
											对于RGB和RGBA纹理,[page:WebGLRenderer WebGL]渲染器在采样此纹理时将使用绿色通道,
							 | 
						|
											因为在DXT压缩和未压缩RGB 565格式中为绿色提供了额外的精度。
							 | 
						|
											Luminance-only以及luminance/alpha纹理也仍然有效。
							 | 
						|
										</p>
							 | 
						|
								
							 | 
						|
										<h3>[property:Color color]</h3>
							 | 
						|
										<p>材质的颜色([page:Color]),默认值为白色 (0xffffff)。 [page:.map]会和 color 相乘。</p>
							 | 
						|
								
							 | 
						|
										<h3>[property:Boolean fog]</h3>
							 | 
						|
										<p>材质是否受雾影响。默认为*true*。</p>
							 | 
						|
								
							 | 
						|
										<h3>[property:Boolean isSpriteMaterial]</h3>
							 | 
						|
										<p>
							 | 
						|
											Read-only flag to check if a given object is of type [name].
							 | 
						|
										</p>
							 | 
						|
								
							 | 
						|
										<h3>[property:Texture map]</h3>
							 | 
						|
										<p>
							 | 
						|
											颜色贴图。可以选择包括一个alpha通道,通常与[page:Material.transparent .transparent]
							 | 
						|
											或[page:Material.alphaTest .alphaTest]。默认为null。
							 | 
						|
										</p>
							 | 
						|
								
							 | 
						|
										<h3>[property:Radians rotation]</h3>
							 | 
						|
										<p> sprite的转动,以弧度为单位。默认值为0。</p>
							 | 
						|
								
							 | 
						|
										<h3>[property:Boolean sizeAttenuation]</h3>
							 | 
						|
										<p> 精灵的大小是否会被相机深度衰减。(仅限透视摄像头。)默认为*true*。</p>
							 | 
						|
								
							 | 
						|
										<h3>[property:Boolean transparent]</h3>
							 | 
						|
										<p>定义此材质是否透明。默认值为 *true*。</p>
							 | 
						|
								
							 | 
						|
										<h2>方法(Methods)</h2>
							 | 
						|
										<p>共有方法请参见其基类[page:Material]。</p>
							 | 
						|
								
							 | 
						|
										<h2>源码(Source)</h2>
							 | 
						|
								
							 | 
						|
										<p>
							 | 
						|
											[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
							 | 
						|
										</p>
							 | 
						|
									</body>
							 | 
						|
								</html>
							 | 
						|
								
							 |