Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. microphone_button.onChange(function(value)
  2. {
  3. var microfono;
  4. var foldermic;
  5.  
  6. if(j>=0 && j<3)
  7. {
  8. microfono = aggiungi_microfono();
  9. //microfono.visible = false;
  10. scene.add(microfono);
  11.  
  12. foldermic = gui.addFolder('Microphone '+j);
  13. var micZ = foldermic.add( gui_controls, 'micz' ).min(-1.8).max(1.8).step(0.1).name('Z-axis');
  14. var rotmicY = foldermic.add( gui_controls, 'rotmicy' ).min(-0.2).max(0.2).step(0.1).name('rotate Y-axis');
  15. var micpanoram = foldermic.add(gui_controls, 'pan_mic'+i).name('Panoramico?');
  16. var micVisibile = foldermic.add(gui_controls, 'micvisible').name('Show');
  17.  
  18. micVisibile.onChange(function(value)
  19. { microfono.traverse( function ( object ) { object.visible = value; } ); });
  20.  
  21. micZ.onChange(function(value)
  22. { microfono.position.z = value;
  23. });
  24.  
  25. rotmicY.onChange(function(value)
  26. { microfono.rotation.y = value; });
  27.  
  28. microfoni[j] = microfono;
  29. foldermics[j] = foldermic;
  30.  
  31.  
  32. j++;
  33. }
  34. else
  35. { alert("Max number of microphone execeed."); };
  36.  
  37. });
  38.  
  39. cam_button.onChange(function(value)
  40. {
  41. var cam;
  42. var foldercam;
  43.  
  44. if(l>=0 && l<3)
  45. {
  46. cam = aggiungi_webcam();
  47. //cam.visible = false;
  48. scene.add(cam);
  49.  
  50. foldercam = gui.addFolder('WebCam '+l);
  51. var camZ = foldercam.add( gui_controls, 'camz' ).min(-1).max(1).step(0.1).name('Z-axis');
  52. var rotcamY = foldercam.add( gui_controls, 'rotcamy' ).min(-0.5).max(0.5).step(0.1).name('rotate Y-axis');
  53. var campanoram = foldermic.add(gui_controls, 'pan_cam'+i).name('Zoomable?');
  54. var camVisibile = foldercam.add(gui_controls, 'camvisible').name('Show');
  55.  
  56. camVisibile.onChange(function(value)
  57. { cam.traverse( function ( object ) { object.visible = value; } ); });
  58.  
  59. camZ.onChange(function(value)
  60. { cam.position.z = value; });
  61.  
  62. rotcamY.onChange(function(value)
  63. { cam.rotation.y = value; });
  64.  
  65. cams[l] = cam;
  66. foldercams[l] = foldercam;
  67. l++;
  68.  
  69. }
  70. else
  71. { alert("Max number of webcams execeed."); };
  72.  
  73. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement