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.
		
		
		
		
		
			
		
			
				
					
					
						
							79 lines
						
					
					
						
							2.3 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							79 lines
						
					
					
						
							2.3 KiB
						
					
					
				
								<!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>
							 | 
						|
									<h1>Come creare contenuti VR ([name])</h1>
							 | 
						|
								
							 | 
						|
									<p>
							 | 
						|
								    Questa guida fornisce una breve panoramica sui componenti di base di un'applicazione VR basata sul web realizzata con three.js.
							 | 
						|
									</p>
							 | 
						|
								
							 | 
						|
									<h2>Workflow</h2>
							 | 
						|
								
							 | 
						|
									<p>
							 | 
						|
								    Prima di tutto devi includere [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/webxr/VRButton.js VRButton.js] nel tuo progetto.
							 | 
						|
									</p>
							 | 
						|
								
							 | 
						|
									<code>
							 | 
						|
								import { VRButton } from 'three/addons/webxr/VRButton.js';
							 | 
						|
									</code>
							 | 
						|
								
							 | 
						|
									<p>
							 | 
						|
								    *VRButton.createButton()* fa due cose importanti: Crea un bottone per indicare la compatibilità con il VR.
							 | 
						|
								    Inoltre, se l'utente attiva il bottone, viene avviata una sessione VR. L'unica cosa che devi fare è aggiungere la seguente
							 | 
						|
								    linea di codice al tuo progetto.
							 | 
						|
									</p>
							 | 
						|
								
							 | 
						|
									<code>
							 | 
						|
								document.body.appendChild( VRButton.createButton( renderer ) );
							 | 
						|
									</code>
							 | 
						|
								
							 | 
						|
									<p>
							 | 
						|
								    Successivamente, hai bisogno di dire alla tua istanza di `WebGLRenderer` di abilitare il rendering XR.
							 | 
						|
									</p>
							 | 
						|
								
							 | 
						|
									<code>
							 | 
						|
								renderer.xr.enabled = true;
							 | 
						|
									</code>
							 | 
						|
								
							 | 
						|
									<p>
							 | 
						|
								    Infine, devi regolare il ciclo di animazione poiché non possiamo utilizzare la nota funzione *window.requestAnimationFrame()*.
							 | 
						|
								    Per i progetti VR viene utilizzato il metodo [page:WebGLRenderer.setAnimationLoop setAnimationLoop].
							 | 
						|
								    Il codice minimo si presenta così:
							 | 
						|
									</p>
							 | 
						|
								
							 | 
						|
									<code>
							 | 
						|
								renderer.setAnimationLoop( function () {
							 | 
						|
								
							 | 
						|
									renderer.render( scene, camera );
							 | 
						|
								
							 | 
						|
								} );
							 | 
						|
									</code>
							 | 
						|
								
							 | 
						|
									<h2>Prossimi passi</h2>
							 | 
						|
								
							 | 
						|
									<p>
							 | 
						|
								    Dai un'occhiata ad uno degli esempi ufficiali di WebVR per vedere questo flusso di lavoro in azione. <br /><br />
							 | 
						|
								
							 | 
						|
										[example:webxr_vr_ballshooter WebXR / VR / ballshooter]<br />
							 | 
						|
										[example:webxr_vr_cubes WebXR / VR / cubes]<br />
							 | 
						|
										[example:webxr_vr_dragging WebXR / VR / dragging]<br />
							 | 
						|
										[example:webxr_vr_paint WebXR / VR / paint]<br />
							 | 
						|
										[example:webxr_vr_panorama_depth WebXR / VR / panorama_depth]<br />
							 | 
						|
										[example:webxr_vr_panorama WebXR / VR / panorama]<br />
							 | 
						|
										[example:webxr_vr_rollercoaster WebXR / VR / rollercoaster]<br />
							 | 
						|
										[example:webxr_vr_sandbox WebXR / VR / sandbox]<br />
							 | 
						|
										[example:webxr_vr_sculpt WebXR / VR / sculpt]<br />
							 | 
						|
										[example:webxr_vr_video WebXR / VR / video]
							 | 
						|
									</p>
							 | 
						|
								
							 | 
						|
								</body>
							 | 
						|
								
							 | 
						|
								</html>
							 | 
						|
								
							 |