Beispiel #1
0
        private void button_Physics_Click(object sender, EventArgs e)
        {
            _state = State.demo6;

            warp3D1.CreateScene(512, 512);
            warp3D1.SetBackgroundColor(0xECE9D8);

            warp3D1.AddMaterial("default", 0x00dd00);
            warp3D1.SetReflectivity("default", 255);

            warp3D1.AddMaterial("yellow", 0xffff00);
            warp3D1.SetReflectivity("yellow", 200);

            warp3D1.AddMaterial("floor", 0xcccccc);
            warp3D1.AddPlane("plane1", 10f);
            warp3D1.SetObjectMaterial("plane1", "floor");


            warp3D1.AddLight("Light1", 0.2f, 0.2f, 1f, 0xFFFFFF, 144, 120);
            warp3D1.AddLight("Light2", -1f, 0f, 0f, 0x332211, 100, 40);
            warp3D1.AddLight("Light3", 1f, 0f, 0f, 0x666666, 200, 120);
            warp3D1.AddCube("cube0", 2f);
            warp3D1.SetObjectMaterial("cube0", "default");

            _world.SetGravity(0, -9.81f, 0);
            _world.CFM      = 1e-6f;
            _floor          = new Ode.PlaneGeom(_space, 0, 1, 0, 0);
            collideCallback = new Ode.CollideHandler(this.CollideCallback);

            _walls    = new PlaneGeom[4];
            _walls[0] = new PlaneGeom(_space, 1, 0, 0, -10);
            _walls[1] = new PlaneGeom(_space, -1, 0, 0, -10);
            _walls[2] = new PlaneGeom(_space, 0, 0, 1, -10);
            _walls[3] = new PlaneGeom(_space, 0, 0, -1, -10);

            InitialiseWorld();

            warp3D1.ShiftDefaultCamera(0f, 0f, -20f);

            button_Body.Enabled   = true;
            button_Sphere.Enabled = true;
        }
Beispiel #2
0
        private void button_Physics_Click( object sender, EventArgs e )
        {

            _state = State.demo6;

            warp3D1.CreateScene( 512, 512 );
            warp3D1.SetBackgroundColor( 0xECE9D8 );

            warp3D1.AddMaterial( "default", 0x00dd00 );
            warp3D1.SetReflectivity( "default", 255 );

			warp3D1.AddMaterial( "yellow", 0xffff00 );
			warp3D1.SetReflectivity( "yellow", 200 );

			warp3D1.AddMaterial( "floor", 0xcccccc );
            warp3D1.AddPlane("plane1", 10f);
            warp3D1.SetObjectMaterial("plane1", "floor");


            warp3D1.AddLight( "Light1", 0.2f, 0.2f, 1f, 0xFFFFFF, 144, 120 );
            warp3D1.AddLight( "Light2", -1f, 0f, 0f, 0x332211, 100, 40 );
            warp3D1.AddLight( "Light3", 1f, 0f, 0f, 0x666666, 200, 120 );
            warp3D1.AddCube( "cube0", 2f );
			warp3D1.SetObjectMaterial( "cube0", "default" );
            
            _world.SetGravity( 0, -9.81f, 0 );
            _world.CFM = 1e-6f;
            _floor = new Ode.PlaneGeom( _space, 0, 1, 0, 0 );
            collideCallback = new Ode.CollideHandler( this.CollideCallback );

            _walls = new PlaneGeom[ 4 ];
            _walls[ 0 ] = new PlaneGeom( _space, 1, 0, 0, -10 );
            _walls[ 1 ] = new PlaneGeom( _space, -1, 0, 0, -10 );
            _walls[ 2 ] = new PlaneGeom( _space, 0, 0, 1, -10 );
            _walls[ 3 ] = new PlaneGeom( _space, 0, 0, -1, -10 );

            InitialiseWorld();

            warp3D1.ShiftDefaultCamera( 0f, 0f, -20f );

            button_Body.Enabled = true;
            button_Sphere.Enabled = true;
        }