Example #1
0
        /// <summary>
        /// Load content for the screen.
        /// </summary>
        /// <param name="GraphicInfo"></param>
        /// <param name="factory"></param>
        /// <param name="contentManager"></param>
        protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            base.LoadContent(GraphicInfo, factory, contentManager);

            {
                ///Uncoment to add your model
                SimpleModel simpleModel = new SimpleModel(factory, "Model/cenario");
                ///Physic info (position, rotation and scale are set here)
                TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
                ///Forward Shader (look at this shader construction for more info)
                ForwardXNABasicShader shader = new ForwardXNABasicShader();
                ///Forward material
                ForwardMaterial fmaterial = new ForwardMaterial(shader);
                ///The object itself
                IObject obj = new IObject(fmaterial, simpleModel, tmesh);
                ///Add to the world
                this.World.AddObject(obj);
            }

            {
                SimpleModel simpleModel = new SimpleModel(factory, "duck");
                simpleModel.SetTexture(factory.CreateTexture2DColor(1, 1, Color.White));
                ///Physic info (position, rotation and scale are set here)
                GhostObject tmesh = new GhostObject(new Vector3(100, 60, 120), Matrix.Identity, Vector3.One);
                ///Forward Shader (look at this shader construction for more info)
                DynEnvMaterial DynEnvMaterial = new PloobsProjectTemplate.TemplateScreens.DynEnvMaterial();
                ///The object itself
                IObject obj = new IObject(DynEnvMaterial, simpleModel, tmesh);
                ///Add to the world
                this.World.AddObject(obj);
            }


            {
                SimpleModel simpleModel = new SimpleModel(factory, "duck");
                simpleModel.SetTexture(factory.CreateTexture2DColor(1, 1, Color.White));
                ///Physic info (position, rotation and scale are set here)
                GhostObject tmesh = new GhostObject(new Vector3(200, 60, 320), Matrix.Identity, Vector3.One);
                ///Forward Shader (look at this shader construction for more info)
                DynEnvMaterial DynEnvMaterial = new PloobsProjectTemplate.TemplateScreens.DynEnvMaterial();
                ///The object itself
                IObject obj = new IObject(DynEnvMaterial, simpleModel, tmesh);
                ///Add to the world
                this.World.AddObject(obj);
            }


            Texture2D t = factory.CreateTexture2DColor(1, 1, Color.Red);

            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    SimpleModel simpleModel = new SimpleModel(factory, "Model/block");
                    simpleModel.SetTexture(t);
                    ///Physic info (position, rotation and scale are set here)
                    BoxObject tmesh = new BoxObject(new Vector3(j * 10 + 200, 100, i * 10 + 200), 1, 1, 1, 10, Vector3.One * 2, Matrix.Identity, MaterialDescription.DefaultBepuMaterial());
                    tmesh.isMotionLess = true;
                    ///Forward Shader (look at this shader construction for more info)
                    ForwardXNABasicShader shader = new ForwardXNABasicShader();
                    ///Forward material
                    ForwardMaterial fmaterial = new ForwardMaterial(shader);
                    ///The object itself
                    IObject obj = new IObject(fmaterial, simpleModel, tmesh);
                    ///Add to the world
                    this.World.AddObject(obj);
                }
            }

            ///add a camera
            this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
        }
        /// <summary>
        /// Load content for the screen.
        /// </summary>
        /// <param name="GraphicInfo"></param>
        /// <param name="factory"></param>
        /// <param name="contentManager"></param>
        protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            base.LoadContent(GraphicInfo, factory, contentManager);

            {
                ///Uncoment to add your model
                SimpleModel simpleModel = new SimpleModel(factory, "Model/cenario");
                ///Physic info (position, rotation and scale are set here)
                TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
                ///Forward Shader (look at this shader construction for more info)
                ForwardXNABasicShader shader = new ForwardXNABasicShader();
                ///Forward material
                ForwardMaterial fmaterial = new ForwardMaterial(shader);
                ///The object itself
                IObject obj = new IObject(fmaterial, simpleModel, tmesh);
                ///Add to the world
                this.World.AddObject(obj);
            }

            {

                SimpleModel simpleModel = new SimpleModel(factory, "duck");
                simpleModel.SetTexture(factory.CreateTexture2DColor(1,1,Color.White));
                ///Physic info (position, rotation and scale are set here)
                GhostObject tmesh = new GhostObject(new Vector3(100, 60, 120), Matrix.Identity, Vector3.One );
                ///Forward Shader (look at this shader construction for more info)
                DynEnvMaterial DynEnvMaterial = new PloobsProjectTemplate.TemplateScreens.DynEnvMaterial();
                ///The object itself
                IObject obj = new IObject(DynEnvMaterial, simpleModel, tmesh);
                ///Add to the world
                this.World.AddObject(obj);
            }


            {

                SimpleModel simpleModel = new SimpleModel(factory, "duck");
                simpleModel.SetTexture(factory.CreateTexture2DColor(1, 1, Color.White));
                ///Physic info (position, rotation and scale are set here)
                GhostObject tmesh = new GhostObject(new Vector3(200, 60, 320), Matrix.Identity, Vector3.One);
                ///Forward Shader (look at this shader construction for more info)
                DynEnvMaterial DynEnvMaterial = new PloobsProjectTemplate.TemplateScreens.DynEnvMaterial();
                ///The object itself
                IObject obj = new IObject(DynEnvMaterial, simpleModel, tmesh);
                ///Add to the world
                this.World.AddObject(obj);
            }


            Texture2D t = factory.CreateTexture2DColor(1, 1, Color.Red);
            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    SimpleModel simpleModel = new SimpleModel(factory, "Model/block");
                    simpleModel.SetTexture(t);
                    ///Physic info (position, rotation and scale are set here)
                    BoxObject tmesh = new BoxObject(new Vector3(j * 10 + 200, 100, i * 10 + 200), 1, 1, 1, 10, Vector3.One * 2, Matrix.Identity, MaterialDescription.DefaultBepuMaterial());
                    tmesh.isMotionLess = true;
                    ///Forward Shader (look at this shader construction for more info)
                    ForwardXNABasicShader shader = new ForwardXNABasicShader();
                    ///Forward material
                    ForwardMaterial fmaterial = new ForwardMaterial(shader);
                    ///The object itself
                    IObject obj = new IObject(fmaterial, simpleModel, tmesh);
                    ///Add to the world
                    this.World.AddObject(obj);

                }
            }

            ///add a camera
            this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
        }