예제 #1
0
파일: Game1.cs 프로젝트: hitoyozake/MKin
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            screenCapture.Init( GraphicsDevice );

            primitive.Initialize( GraphicsDevice );

            for( int i = 0; i < 2; ++i )
            {
                capturedTextures[ i ] = new Texture2D( GraphicsDevice, 640, 480 );
            }

            //Font
            font = Content.Load<SpriteFont>("myfont");

            // TODO: use this.Content to load your game content here
            arm.model = Content.Load<Model>("arm");
            uArm.model = Content.Load<Model>("uArm");
            hand.model = Content.Load<Model>("hand");
            head.model = Content.Load<Model>("head");
            body.model = Content.Load<Model>( "body" );//("body");

            uArmR.model = Content.Load<Model>( "Ruarm" );
            uArmL.model = Content.Load<Model>( "Luarm" );
            armR.model = Content.Load<Model>( "Rarm" );
            armL.model = Content.Load<Model>( "Larm" );

            legL.model = Content.Load<Model>("Lleg");
            legR.model = Content.Load<Model>("Rleg");
            thighL.model = Content.Load<Model>("Lthigh");
            thighR.model = Content.Load<Model>("Rthigh");

            footL.model = Content.Load<Model>( "footL" );
            footR.model = Content.Load<Model>( "footR" );
            handL.model = Content.Load<Model>( "handL" );
            handR.model = Content.Load<Model>( "handR" );
            underTrunk.model = Content.Load<Model>( "underTrunk" );

            xAxis = Content.Load<Model>("x");
            yAxis = Content.Load<Model>("y");
            zAxis = Content.Load<Model>("z");

            Vector3 cameraPosition = new Vector3(0f, 0, 15f);

            //*******************************************
            loadedImage = this.Content.Load<Texture2D>( "sampleImage" );
            tmpScreenCaptured = new Texture2D( GraphicsDevice, 640, 480 );

            Color[] pixels = new Color[ loadedImage.Width * loadedImage.Height ];
            loadedImage.GetData( pixels );
            texture2DBackColor = pixels[ 0 ];

            ReplaceColor( ref loadedImage, texture2DBackColor, xnaBackColor );

            //*******************************************
            InitializeAxises( cameraPosition : cameraPosition );
            //���X�g�̏�����

            bodyParts.Clear();
            for( int i = 0; i < ( int )BodyPartsName.Size; ++i )
            {
                bodyParts.Add( null );
            }
            //*******************************************
                body.Init( GraphicsDevice );
            //uArmL.Init( GraphicsDevice );
            //uArmL.position.Y = 1.1f;

            //uArmL.parent = body;

            //bodyParts.Add( body );
            //bodyParts.Add( uArmL );
            InitializeBodyParts();

            for( int i = 0; i < cameraPositions.Length; ++i )
                teacherTexture[ i ] = new Texture2D( GraphicsDevice, 640, 480 );

            foreach( var parts in bodyParts )
            {
                parts.ChangeCameraPosition( cameraPositions[ 0 ].X, cameraPositions[ 0 ].Y, cameraPositions[ 0 ].Z );
                parts.Update();
            }

            Kinect.KinectManager manager = new Kinect.KinectManager();
            byte [] d = new byte[ 10 ];
            manager.TransformDepthTo3D( d );
        }
예제 #2
0
파일: Game1.cs 프로젝트: hitoyozake/MKin
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            screenCapture.Init(GraphicsDevice);

            primitive.Initialize(GraphicsDevice);

            for (int i = 0; i < 2; ++i)
            {
                capturedTextures[i] = new Texture2D(GraphicsDevice, 640, 480);
            }

            //Font
            font = Content.Load <SpriteFont>("myfont");

            // TODO: use this.Content to load your game content here
            arm.model  = Content.Load <Model>("arm");
            uArm.model = Content.Load <Model>("uArm");
            hand.model = Content.Load <Model>("hand");
            head.model = Content.Load <Model>("head");
            body.model = Content.Load <Model>("body"); //("body");

            uArmR.model = Content.Load <Model>("Ruarm");
            uArmL.model = Content.Load <Model>("Luarm");
            armR.model  = Content.Load <Model>("Rarm");
            armL.model  = Content.Load <Model>("Larm");

            legL.model   = Content.Load <Model>("Lleg");
            legR.model   = Content.Load <Model>("Rleg");
            thighL.model = Content.Load <Model>("Lthigh");
            thighR.model = Content.Load <Model>("Rthigh");

            footL.model      = Content.Load <Model>("footL");
            footR.model      = Content.Load <Model>("footR");
            handL.model      = Content.Load <Model>("handL");
            handR.model      = Content.Load <Model>("handR");
            underTrunk.model = Content.Load <Model>("underTrunk");

            xAxis = Content.Load <Model>("x");
            yAxis = Content.Load <Model>("y");
            zAxis = Content.Load <Model>("z");

            Vector3 cameraPosition = new Vector3(0f, 0, 15f);

            //*******************************************
            loadedImage       = this.Content.Load <Texture2D>("sampleImage");
            tmpScreenCaptured = new Texture2D(GraphicsDevice, 640, 480);

            Color[] pixels = new Color[loadedImage.Width * loadedImage.Height];
            loadedImage.GetData(pixels);
            texture2DBackColor = pixels[0];

            ReplaceColor(ref loadedImage, texture2DBackColor, xnaBackColor);

            //*******************************************
            InitializeAxises(cameraPosition: cameraPosition);
            //リストの初期化

            bodyParts.Clear();
            for (int i = 0; i < ( int )BodyPartsName.Size; ++i)
            {
                bodyParts.Add(null);
            }
            //*******************************************
            body.Init(GraphicsDevice);
            //uArmL.Init( GraphicsDevice );
            //uArmL.position.Y = 1.1f;

            //uArmL.parent = body;

            //bodyParts.Add( body );
            //bodyParts.Add( uArmL );
            InitializeBodyParts();

            for (int i = 0; i < cameraPositions.Length; ++i)
            {
                teacherTexture[i] = new Texture2D(GraphicsDevice, 640, 480);
            }

            foreach (var parts in bodyParts)
            {
                parts.ChangeCameraPosition(cameraPositions[0].X, cameraPositions[0].Y, cameraPositions[0].Z);
                parts.Update();
            }

            Kinect.KinectManager manager = new Kinect.KinectManager();
            byte [] d = new byte[10];
            manager.TransformDepthTo3D(d);
        }