home *** CD-ROM | disk | FTP | other *** search
- var wt, stage, amblgt, cam;
- var CAMX =0, CAMY =0, CAMZ =-200, CAMFOV=50;
- var AMBLGTCOLOR = 230;
- var Box;
- var BoxContainer;
- var BoxTexture;
- var WTLT_AMBIENT = 0;
-
- function init( UseFullScreen )
- {
- wt = document.wtobj;
- stage = wt.createStage();
- stage.setBGColor(0,0,0);
- cam = stage.createCamera();
- amblgt = wt.createLight(WTLT_AMBIENT); amblgt.setColor( AMBLGTCOLOR, AMBLGTCOLOR, AMBLGTCOLOR);
- stage.addObject(amblgt);
- cam.setPosition(CAMX, CAMY, CAMZ);
- cam.setLookAt( amblgt ); cam.unsetLookAt(); cam.setFieldOfView(CAMFOV);
-
- if ( UseFullScreen )
- {
- if ( wt.setResolution(640,480,16 ) )
- {
- cam.setViewRect(0,0,640,480);
- }
- }
-
- BoxTexture = wt.createBitmap( "logo.wpg" );
- Box = wt.createBox( 100, 100, 100 );
- Box.setTexture( BoxTexture );
- BoxContainer = wt.createContainer();
- BoxContainer.attach( Box );
- BoxContainer.setConstantRotation( 0, 0.5, 1.0, 45 );
- stage.addObject( BoxContainer );
-
- wt.overrideExceptionEvent( 0, true );
-
- wt.start();
- }
-