Example #1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();


            Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.Pi / 4.0f, GraphicsDevice.Viewport.Width / GraphicsDevice.Viewport.Height, 1.0f, 2000.0f);
            View       = Matrix.CreateLookAt(new Vector3(0, 0, 5), Vector3.Zero, Vector3.Up);
            World      = Matrix.Identity;



            Head = new Mesh();
            Head.Read(File.ReadAllBytes("head.mesh"));

            Body = new Mesh();
            Body.Read(File.ReadAllBytes("body.mesh"));

            HeadTexture = Texture2D.FromFile(GraphicsDevice, "head.jpg");
            BodyTexture = Texture2D.FromFile(GraphicsDevice, "body.jpg");

            RightHand = new Mesh();
            RightHand.Read(File.ReadAllBytes("rhand.mesh"));

            LeftHand = new Mesh();
            LeftHand.Read(File.ReadAllBytes("lhand.mesh"));

            RightHandTexture = Texture2D.FromFile(GraphicsDevice, "hand.jpg");
            LeftHandTexture  = Texture2D.FromFile(GraphicsDevice, "hand.jpg");

            Skelenton = new Skelenton();
            Skelenton.Read(File.ReadAllBytes("skeleton.skel"));
        }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();

            Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.Pi / 4.0f, GraphicsDevice.Viewport.Width / GraphicsDevice.Viewport.Height, 1.0f, 2000.0f);
            View = Matrix.CreateLookAt(new Vector3(0, 0, 5), Vector3.Zero, Vector3.Up);
            World = Matrix.Identity;

            Head = new Mesh();
            Head.Read(File.ReadAllBytes("head.mesh"));

            Body = new Mesh();
            Body.Read(File.ReadAllBytes("body.mesh"));

            HeadTexture = Texture2D.FromFile(GraphicsDevice, "head.jpg");
            BodyTexture = Texture2D.FromFile(GraphicsDevice, "body.jpg");

            RightHand = new Mesh();
            RightHand.Read(File.ReadAllBytes("rhand.mesh"));

            LeftHand = new Mesh();
            LeftHand.Read(File.ReadAllBytes("lhand.mesh"));

            RightHandTexture = Texture2D.FromFile(GraphicsDevice, "hand.jpg");
            LeftHandTexture = Texture2D.FromFile(GraphicsDevice, "hand.jpg");

            Skelenton = new Skelenton();
            Skelenton.Read(File.ReadAllBytes("skeleton.skel"));
        }