gui.js 934 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. var transitionParams = {
  2. "useTexture": true,
  3. "transition": 0.5,
  4. "transitionSpeed": 2.0,
  5. "texture": 5,
  6. "loopTexture": true,
  7. "animateTransition": true,
  8. "textureThreshold": 0.3
  9. };
  10. function initGUI() {
  11. var gui = new dat.GUI();
  12. gui.add( transitionParams, "useTexture" ).onChange( function( value ) {
  13. transition.useTexture( value );
  14. } );
  15. gui.add( transitionParams, 'loopTexture' );
  16. gui.add( transitionParams, 'texture', { Perlin: 0, Squares: 1, Cells: 2, Distort: 3, Gradient: 4, Radial: 5 } ).onChange( function( value ) {
  17. transition.setTexture( value );
  18. } ).listen();
  19. gui.add( transitionParams, "textureThreshold", 0, 1, 0.01 ).onChange( function( value ) {
  20. transition.setTextureThreshold( value );
  21. } );
  22. gui.add( transitionParams, "animateTransition" );
  23. gui.add( transitionParams, "transition", 0, 1, 0.01 ).listen();
  24. gui.add( transitionParams, "transitionSpeed", 0.5, 5, 0.01 );
  25. }