Beispiel #1
0
        public void LoadContent()
        {
            // this is all you need to do to if your 3d model is static, or all the meshes have the pivot at the origin, or your 3d package exports pivot points.
            runner = new object3d(globals.Content.Load<Model>("runner"));

            // if your 3d package doesn't export pivot points properly, and you rotate bones using them, and they dont pivot round the origin, you will need to manually set them up like this:
            runner.SetPivotPoint("ShinL", new Vector3(0, 0, 20));
            runner.SetPivotPoint("ShinR", new Vector3(0, 0, 20));
            runner.SetPivotPoint("LowerArmL", new Vector3(0, 0, 20));
            runner.SetPivotPoint("LowerArmR", new Vector3(0, 0, 20));
            runner.SetPivotPoint("Neck", new Vector3(0, 0, 45));
            runner.SetPivotPoint("ShoulderL", new Vector3(0, 0, 45));
            runner.SetPivotPoint("ShoulderR", new Vector3(0, 0, 45));
            
            // if your 3d model does not include textures, you can add them to individual meshes like this:
            Texture2D tex1 = globals.Content.Load<Texture2D>("tex");
            Texture2D tex2 = globals.Content.Load<Texture2D>("tex2");
            runner.SetTexture("ShinRMesh", tex1);
            runner.SetTexture("ShinLMesh", tex1);
            runner.SetTexture("ThighRMesh", tex1);
            runner.SetTexture("ThighLMesh", tex1);
            runner.SetTexture("ArmUpperLMesh", tex1);
            runner.SetTexture("ArmUpperRMesh", tex1);
            runner.SetTexture("ArmLowerLMesh", tex1);
            runner.SetTexture("ArmLowerRMesh", tex1);
            runner.SetTexture("NeckMesh", tex1);
            runner.SetTexture("HEIDMesh", tex1);
            runner.SetTexture("FootLMesh", tex2);
            runner.SetTexture("FootRMesh", tex2);
            runner.SetTexture("BodyMesh", tex2);
            runner.SetTexture("ShoulderLMesh", tex2);
            runner.SetTexture("ShoulderRMesh", tex2);
            runner.rotation.Z = (float)Math.PI / 2;
        }
Beispiel #2
0
        public void LoadContent()
        {
            // this is all you need to do to if your 3d model is static, or all the meshes have the pivot at the origin, or your 3d package exports pivot points.
            runner = new object3d(globals.Content.Load<Model>("runner"));

            // if your 3d package doesn't export pivot points properly, and you rotate bones using them, and they dont pivot round the origin, you will need to manually set them up like this:
            runner.SetPivotPoint("ShinL", new Vector3(0, 0, 20));
            runner.SetPivotPoint("ShinR", new Vector3(0, 0, 20));
            runner.SetPivotPoint("LowerArmL", new Vector3(0, 0, 20));
            runner.SetPivotPoint("LowerArmR", new Vector3(0, 0, 20));
            runner.SetPivotPoint("Neck", new Vector3(0, 0, 45));
            runner.SetPivotPoint("ShoulderL", new Vector3(0, 0, 45));
            runner.SetPivotPoint("ShoulderR", new Vector3(0, 0, 45));
            
            // if your 3d model does not include textures, you can add them to individual meshes like this:
            Texture2D tex1 = globals.Content.Load<Texture2D>("tex");
            Texture2D tex2 = globals.Content.Load<Texture2D>("tex2");
            runner.SetTexture("ShinRMesh", tex1);
            runner.SetTexture("ShinLMesh", tex1);
            runner.SetTexture("ThighRMesh", tex1);
            runner.SetTexture("ThighLMesh", tex1);
            runner.SetTexture("ArmUpperLMesh", tex1);
            runner.SetTexture("ArmUpperRMesh", tex1);
            runner.SetTexture("ArmLowerLMesh", tex1);
            runner.SetTexture("ArmLowerRMesh", tex1);
            runner.SetTexture("NeckMesh", tex1);
            runner.SetTexture("HEIDMesh", tex1);
            runner.SetTexture("FootLMesh", tex2);
            runner.SetTexture("FootRMesh", tex2);
            runner.SetTexture("BodyMesh", tex2);
            runner.SetTexture("ShoulderLMesh", tex2);
            runner.SetTexture("ShoulderRMesh", tex2);
            runner.rotation.Z = (float)Math.PI / 2;

            judge = new object3d(globals.Content.Load<Model>("pothead"));
            judge.position = new Vector3(500, 150, 0);
            Model groundmodel = globals.Content.Load<Model>("ground");
            ground = new object3d[20];
            for (int count = 0; count < ground.Count(); count++)
            {
                ground[count] = new object3d(groundmodel);
                ground[count].rotation.X = (float)Math.PI / 2;
                ground[count].scale = 2;
                ground[count].position.Z = -70;
                ground[count].position.Y = 40 + 250 * (int)(count/5);
                ground[count].position.X = -200 + 250 * (count%5);
            }
            minigamefont = globals.Content.Load<SpriteFont>("Verdana");
            bars = globals.Content.Load<Texture2D>("2d_bars");
        }