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.
		
		
		
		
			
				
					117 lines
				
				4.5 KiB
			
		
		
			
		
	
	
					117 lines
				
				4.5 KiB
			| 
								 
											3 years ago
										 
									 | 
							
								<!DOCTYPE html>
							 | 
						||
| 
								 | 
							
								<html lang="it">
							 | 
						||
| 
								 | 
							
									<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">Il materiale predefinito utilizzato da [page:Points].</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Codice di Esempio</h2>
							 | 
						||
| 
								 | 
							
										<code>
							 | 
						||
| 
								 | 
							
										const vertices = [];
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										for ( let i = 0; i < 10000; i ++ ) {
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
											const x = THREE.MathUtils.randFloatSpread( 2000 );
							 | 
						||
| 
								 | 
							
											const y = THREE.MathUtils.randFloatSpread( 2000 );
							 | 
						||
| 
								 | 
							
											const z = THREE.MathUtils.randFloatSpread( 2000 );
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
											vertices.push( x, y, z );
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										const geometry = new THREE.BufferGeometry();
							 | 
						||
| 
								 | 
							
										geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										const material = new THREE.PointsMaterial( { color: 0x888888 } );
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										const points = new THREE.Points( geometry, material );
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										scene.add( points );
							 | 
						||
| 
								 | 
							
										</code>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Esempi</h2>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
											[example:misc_controls_fly misc / controls / fly]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_buffergeometry_drawrange WebGL / BufferGeometry / drawrange]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_buffergeometry_points WebGL / BufferGeometry / points]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_buffergeometry_points_interleaved WebGL / BufferGeometry / points / interleaved]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_camera WebGL / camera ]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_geometry_convex WebGL / geometry / convex]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_geometry_shapes WebGL / geometry / shapes]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_interactive_raycasting_points WebGL / interactive / raycasting / points]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_multiple_elements_text WebGL / multiple / elements / text]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_points_billboards WebGL / points / billboards]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_points_dynamic WebGL / points / dynamic]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_points_sprites WebGL / points / sprites]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_trails WebGL / trails]
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Costruttore</h2>
							 | 
						||
| 
								 | 
							
										<h3>[name]( [param:Object parameters] )</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
											[page:Object parameters] - (opzionale) un oggetto con una o più proprietà che definiscono l'aspetto del materiale.
							 | 
						||
| 
								 | 
							
											Qualsiasi proprietà del materiale (inclusa qualsiasi proprietà ereditata da [page:Material]) può essere passata qui. <br /><br />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
											L'eccezione è la proprietà [page:Hexadecimal colore], la quale può essere passata come stringa
							 | 
						||
| 
								 | 
							
											esadecimale e per impostazione predefinita è `0xffffff` (bianco). [page:Color.set]( color ) viene chiamato internamente.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Proprietà</h2>
							 | 
						||
| 
								 | 
							
										<p>Vedi la classe base [page:Material] per le proprietà comuni.</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Texture alphaMap]</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
											La mappa alfa è una texture in scala di grigi che controlla l'opacità sulla superficie
							 | 
						||
| 
								 | 
							
											(nero: completamente trasparente; bianco: completamente opaco). Il valore predefinito è `null`.<br /><br />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
											Viene utilizzato solo il colore della texture, ignorando il canale alfa, se esiste.
							 | 
						||
| 
								 | 
							
											Per le texuture RGB e RGBA, il renderer [page:WebGLRenderer WebGL] utilizzarà il canale del verde 
							 | 
						||
| 
								 | 
							
											durante il campionamento di questa texture a causa del bit extra di precisione fornito per il verde
							 | 
						||
| 
								 | 
							
											nei formati RGB 565 compressi e non compressi DXT. Anche le texture solo luminanza e luminanza/alfa continueranno
							 | 
						||
| 
								 | 
							
											a funzionare come previsto.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Color color]</h3>
							 | 
						||
| 
								 | 
							
										<p>Il [page:Color Colore] del materiale, da impostazione predefinita impostato su bianco (0xffffff).</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Boolean fog]</h3>
							 | 
						||
| 
								 | 
							
										<p>Indica se il materiale è influenzato dalla nebbia. Il valore predefinito è `true`.</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Texture map]</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
											Imposta il colore dei punti utilizzando i dati da una [page:Texture].
							 | 
						||
| 
								 | 
							
											Può includere facoltativamente un canale alfa, in genere combinato con 
							 | 
						||
| 
								 | 
							
											[page:Material.transparent .transparent] o [page:Material.alphaTest .alphaTest].
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Number size]</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
											Definisce la dimensione dei punti in pixel. Il valore predefinito è 1.0.<br/>
							 | 
						||
| 
								 | 
							
											Verrà limitato se supera il parametro dipendetente dall'hardware [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParameter gl.ALIASED_POINT_SIZE_RANGE].
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Boolean sizeAttenuation]</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
											Specifica se la dimensione dei punti viene attenuata dalla profondità della telecamera. (Solo telecamera prospettica). 
							 | 
						||
| 
								 | 
							
											Il valore predefinito è `true`.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Metodi</h2>
							 | 
						||
| 
								 | 
							
										<p>Vedi la classe base [page:Material] per i metodi comuni.</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Source</h2>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
											[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
									</body>
							 | 
						||
| 
								 | 
							
								</html>
							 |