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.
		
		
		
		
			
				
					215 lines
				
				7.8 KiB
			
		
		
			
		
	
	
					215 lines
				
				7.8 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:Object3D] → [page:Camera] →
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h1>[name]</h1>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<p class="desc">
							 | 
						||
| 
								 | 
							
								      Telecamera che utilizza la [link:https://en.wikipedia.org/wiki/Perspective_(graphical) proiezione prospettica].<br /><br />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								      Questa modalità di proiezione è progettata per imitare il modo in cui l'occhio umano vede. È la proiezione 
							 | 
						||
| 
								 | 
							
								      più comunemente utilizzata per il rendering di una scena 3D.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Codice di Esempio</h2>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<code>
							 | 
						||
| 
								 | 
							
										const camera = new THREE.PerspectiveCamera( 45, width / height, 1, 1000 );
							 | 
						||
| 
								 | 
							
										scene.add( camera );
							 | 
						||
| 
								 | 
							
										</code>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Esempi</h2>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
											[example:webgl_animation_skinning_blending animation / skinning / blending ]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_animation_skinning_morph animation / skinning / morph ]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_effects_stereo effects / stereo ]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_interactive_cubes interactive / cubes ]<br />
							 | 
						||
| 
								 | 
							
											[example:webgl_loader_collada_skinning loader / collada / skinning ]
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Costruttore</h2>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[name]( [param:Number fov], [param:Number aspect], [param:Number near], [param:Number far] )</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      fov — Campo visivo verticale del frustum della telecamera.<br />
							 | 
						||
| 
								 | 
							
								      aspect — Aspect ratio del frustum della telecamera.<br />
							 | 
						||
| 
								 | 
							
								      near — Piano near del frustum della telecamera.<br />
							 | 
						||
| 
								 | 
							
								      far — Piano far del frustum della telecamera.<br /><br />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								      Queste proprietà insieme definiscono il [link:https://en.wikipedia.org/wiki/Viewing_frustum frustum visivo] della telecamera.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Proprietà</h2>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Vedi la classe base [page:Camera] per le proprietà comuni.<br>
							 | 
						||
| 
								 | 
							
								      Si noti che dopo aver apportato modifiche alla maggior parte di queste proprietà 
							 | 
						||
| 
								 | 
							
								      sarà necessario chiamare il metodo [page:PerspectiveCamera.updateProjectionMatrix .updateProjectionMatrix]
							 | 
						||
| 
								 | 
							
								      affinché le modifiche abbiano effetto.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Float aspect]</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Aspect ratio del frustum della telecamera, di solito calcolato con la larghezza del canvas / l'altezza del canvas. 
							 | 
						||
| 
								 | 
							
								      Il valore predefinito è `1` (canvas quadrato).
							 | 
						||
| 
								 | 
							
								    </p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Float far]</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Piano far del frustum della telecamera. Il valore predefinito è `2000`.<br /><br />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								      Deve essere maggiore del valore corrente del piano [page:.near near].
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Float filmGauge]</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Dimensioni della pellicola utilizzata per l'asse maggiore. Il valore predefinito è 35 (millimetri).
							 | 
						||
| 
								 | 
							
								      Questo parametro non influenza la matrice di proiezione a meno che .filmOffset non sia impostato su un valore diverso da zero.
							 | 
						||
| 
								 | 
							
								    </p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Float filmOffset]</h3>
							 | 
						||
| 
								 | 
							
										<p>Offset orizzontale decentrato nella stessa unità di `.filmGauge`. Il valore predefinito è `0`.</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Float focus]</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Distanza dell'oggetto utilizzata per la stereoscopia e gli effetti di profondità di campo.
							 | 
						||
| 
								 | 
							
								      Questo parametro non influenza la matrice di proiezione a meno che non venga utilizzata una [page:StereoCamera].
							 | 
						||
| 
								 | 
							
								      Il valore predefinito è `10`.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Float fov]</h3>
							 | 
						||
| 
								 | 
							
										<p>Campo visivo verticale del frustum della telecamera, dal basso all'alto della vista, in gradi. Il valore predefinito è `50`.</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Boolean isPerspectiveCamera]</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Flag di sola lettura che verifica se la telecamera è di tipo [name].
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Float near]</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Piano near del frustum della telecamera. Il valore predefinito è `0.1`.<br /><br />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								      L'intervallo valido è tra `0` e il valore corrente del piano [page:.far far].
							 | 
						||
| 
								 | 
							
								      Si noti che, diversamente dalla [page:OrthographicCamera], `0` <em>non</em> è un valore valido 
							 | 
						||
| 
								 | 
							
								      per il piano near della PerspectiveCamera.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:Object view]</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Specifica la window del frustum o null.
							 | 
						||
| 
								 | 
							
								      Questo valore viene impostato utilizzando il metodo [page:PerspectiveCamera.setViewOffset .setViewOffset]
							 | 
						||
| 
								 | 
							
								      e cancellato utilizzando il metodo [page:PerspectiveCamera.clearViewOffset .clearViewOffset].
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[property:number zoom]</h3>
							 | 
						||
| 
								 | 
							
										<p>Ottiene o imposta il fattore zoom della telecamera. Il valore predefinito è `1`.</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Metodi</h2>
							 | 
						||
| 
								 | 
							
										<p>Vedi la classe base [page:Camera] per i metodi comuni.</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[method:undefined clearViewOffset]()</h3>
							 | 
						||
| 
								 | 
							
										<p>Rimuove qualsiasi offset impostato dal metodo [page:PerspectiveCamera.setViewOffset .setViewOffset].</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[method:Float getEffectiveFOV]()</h3>
							 | 
						||
| 
								 | 
							
										<p>Restituisce l'angolo verticale del campo visivo corrente in gradi considerando .zoom.</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[method:Float getFilmHeight]()</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Restituisce l'altezza dell'immagine sulla pellicola. Se .aspect è minore o uguale a uno
							 | 
						||
| 
								 | 
							
								      (formato verticale), il risultato è uguale a .filmGauge.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[method:Float getFilmWidth]()</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Restituisce la larghezza dell'immagine sulla pellicola. Se .aspect è maggiore o uguale ad uno (formato orizzontale),
							 | 
						||
| 
								 | 
							
								      il risultato è uguale a .filmGauge.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[method:Float getFocalLength]()</h3>
							 | 
						||
| 
								 | 
							
										<p>Restituisce la lunghezza focale del .fov corrente rispetto a .filmGauge.</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[method:undefined setFocalLength]( [param:Float focalLength] )</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Imposta il valore FOV in base alla lunghezza focale rispetto al [page:PerspectiveCamera.filmGauge .filmGauge] corrente.<br /><br />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								      Per impostazione predefinita, la lunghezza focale è specificata per una telecamera da 35mm (full frame).
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[method:undefined setViewOffset]( [param:Float fullWidth], [param:Float fullHeight], [param:Float x], [param:Float y], [param:Float width], [param:Float height] )</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      fullWidth — larghezza totale dell'impostazione multiview<br />
							 | 
						||
| 
								 | 
							
								      fullHeight — altezza totale dell'impostazione multiview<br />
							 | 
						||
| 
								 | 
							
								      x — offset orizzontale della telecamera secondaria<br />
							 | 
						||
| 
								 | 
							
								      y — offset verticale della telecamera secondaria<br />
							 | 
						||
| 
								 | 
							
								      width — larghezza della telecamera secondaria<br />
							 | 
						||
| 
								 | 
							
								      height — altezza della telecamera secondaria<br /><br />
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Imposta un offset in un frustum più ampio. È utile per le configurazioni multi-window o multi-monitor/multi-machine.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Per esempio, se si dispone di 3x2 monitor e ogni monitor è un 1920x1080 e i monitor sono disposti in una griglia come questa:<br />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<pre>
							 | 
						||
| 
								 | 
							
								+---+---+---+
							 | 
						||
| 
								 | 
							
								| A | B | C |
							 | 
						||
| 
								 | 
							
								+---+---+---+
							 | 
						||
| 
								 | 
							
								| D | E | F |
							 | 
						||
| 
								 | 
							
								+---+---+---+
							 | 
						||
| 
								 | 
							
										</pre>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    allora per ogni monitor il metodo verrebbe chiamato in questo modo:<br />
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<code>const w = 1920;
							 | 
						||
| 
								 | 
							
								const h = 1080;
							 | 
						||
| 
								 | 
							
								const fullWidth = w * 3;
							 | 
						||
| 
								 | 
							
								const fullHeight = h * 2;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								// A
							 | 
						||
| 
								 | 
							
								camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );
							 | 
						||
| 
								 | 
							
								// B
							 | 
						||
| 
								 | 
							
								camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );
							 | 
						||
| 
								 | 
							
								// C
							 | 
						||
| 
								 | 
							
								camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );
							 | 
						||
| 
								 | 
							
								// D
							 | 
						||
| 
								 | 
							
								camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );
							 | 
						||
| 
								 | 
							
								// E
							 | 
						||
| 
								 | 
							
								camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
							 | 
						||
| 
								 | 
							
								// F
							 | 
						||
| 
								 | 
							
								camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
							 | 
						||
| 
								 | 
							
								</code>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								      Si noti che non c'è motivo per cui i monitor debbano essere della stessa dimensione o in una griglia.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[method:undefined updateProjectionMatrix]()</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      Aggiorna la matrice di proiezione della telecamera. Deve essere chiamato dopo ogni modifica dei parametri.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h3>[method:Object toJSON]([param:Object meta])</h3>
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
								      meta -- oggetto contenente metadati come texture o immagini nei discendenti degli oggetti.<br />
							 | 
						||
| 
								 | 
							
								      Converte la fotocamera nel [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 formato JSON Object/Scene] di three.js.
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<h2>Source</h2>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
										<p>
							 | 
						||
| 
								 | 
							
											[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
							 | 
						||
| 
								 | 
							
										</p>
							 | 
						||
| 
								 | 
							
									</body>
							 | 
						||
| 
								 | 
							
								</html>
							 |