home *** CD-ROM | disk | FTP | other *** search
/ Screensavers (Millenium Edition) / Screensavers (Millenium Edition).iso / Software / 3dfx / Holiday / holidaytheme.exe / default / prog.js < prev    next >
Encoding:
Text File  |  2000-02-11  |  1013 b   |  40 lines

  1. var wt, stage, amblgt, cam;            
  2. var CAMX =0, CAMY =0, CAMZ =-200, CAMFOV=50; 
  3. var AMBLGTCOLOR = 230;
  4. var    Box;
  5. var    BoxContainer;
  6. var    BoxTexture;
  7. var WTLT_AMBIENT = 0;
  8.  
  9. function init( UseFullScreen )
  10. {
  11.     wt = document.wtobj;
  12.     stage = wt.createStage();
  13.     stage.setBGColor(0,0,0);
  14.     cam = stage.createCamera();
  15.     amblgt = wt.createLight(WTLT_AMBIENT); amblgt.setColor( AMBLGTCOLOR, AMBLGTCOLOR, AMBLGTCOLOR);
  16.     stage.addObject(amblgt);
  17.     cam.setPosition(CAMX, CAMY, CAMZ);
  18.     cam.setLookAt( amblgt ); cam.unsetLookAt(); cam.setFieldOfView(CAMFOV);
  19.  
  20.     if ( UseFullScreen )
  21.     {
  22.         if ( wt.setResolution(640,480,16 ) )
  23.         {
  24.             cam.setViewRect(0,0,640,480);
  25.         }
  26.     }        
  27.  
  28.     BoxTexture = wt.createBitmap( "logo.wpg" );
  29.     Box = wt.createBox( 100, 100, 100 );
  30.     Box.setTexture( BoxTexture );
  31.     BoxContainer = wt.createContainer();
  32.     BoxContainer.attach( Box );
  33.     BoxContainer.setConstantRotation( 0, 0.5, 1.0, 45 );
  34.     stage.addObject( BoxContainer );
  35.     
  36.     wt.overrideExceptionEvent( 0, true );
  37.     
  38.     wt.start();
  39. }
  40.