Example #1
0
        protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            base.LoadContent(GraphicInfo, factory, contentManager);

            ExtractXmlModelLoader ext = new ExtractXmlModelLoader("Content//ModelInfos//", "Model//", "Textures//");

            this.AttachCleanUpAble(ext);
            ModelLoaderData data = ext.Load(factory, GraphicInfo, "shadow");
            WorldLoader     wl   = new WorldLoader();

            wl.OnCreateIObject += new CreateIObject(wl_OnCreateIObject);
            wl.OnCreateILight  += new CreateILight(wl_OnCreateILight);
            wl.LoadWorld(factory, GraphicInfo, World, data);

            #region NormalLight
            {
                ld1             = new DirectionalLightPE(new Vector3(0.2f, -1, 0.2f), Color.White);
                ld1.CastShadown = false;
                float li = 0.9f;
                ld1.LightIntensity = li;
                this.World.AddLight(ld1);
            }

            {
                ld1             = new DirectionalLightPE(new Vector3(0.2f, -1, 0.2f), Color.Red);
                ld1.CastShadown = true;
                float li = 2.0f;
                ld1.LightIntensity = li;
                this.World.AddLight(ld1);
            }


            #endregion

            CameraFirstPerson cam = new CameraFirstPerson(GraphicInfo);
            cam.MoveSpeed *= 5;
            this.World.CameraManager.AddCamera(cam);

            SkyBoxSetTextureCube stc = new SkyBoxSetTextureCube("Textures//grasscube");
            CommandProcessor.getCommandProcessor().SendCommandAssyncronous(stc);

            ///Interpolator to change lightDirection
            inter.Start(new Vector3(0, -1, 0), new Vector3(1, -1, 1), 3, true);

            this.RenderTechnic.AddPostEffect(new AntiAliasingPostEffect());
        }
Example #2
0
        public void Start(Vector3 p1, Vector3 p2, Vector3 t1, Vector3 t2, Vector3 u1, Vector3 u2, float field1, float field2, float aspect1, float aspect2, float near1, float near2, float far1, float far2)
        {
            _pinterp      = new Vec3Interpolator();
            _tinterp      = new Vec3Interpolator();
            _uinterp      = new Vec3Interpolator();
            _fieldinterp  = new FloatInterpolator();
            _aspectinterp = new FloatInterpolator();
            _nearinterp   = new FloatInterpolator();
            _farinterp    = new FloatInterpolator();

            _pinterp.Start(p1, p2, _timeInSeconds);
            _tinterp.Start(t1, t2, _timeInSeconds);
            _uinterp.Start(u1, u2, _timeInSeconds);
            _fieldinterp.Start(field1, field2, _timeInSeconds);
            _aspectinterp.Start(aspect1, aspect2, _timeInSeconds);
            _nearinterp.Start(near1, near2, _timeInSeconds);
            _farinterp.Start(far1, far2, _timeInSeconds);
        }
        public void Start(Vector3 p1, Vector3 p2, Vector3 t1, Vector3 t2, Vector3 u1, Vector3 u2, float field1, float field2, float aspect1, float aspect2, float near1, float near2, float far1, float far2)
        {
            _pinterp = new Vec3Interpolator();
            _tinterp = new Vec3Interpolator();
            _uinterp = new Vec3Interpolator();
            _fieldinterp = new FloatInterpolator();
            _aspectinterp = new FloatInterpolator();
            _nearinterp = new FloatInterpolator();
            _farinterp = new FloatInterpolator();

            _pinterp.Start(p1,p2, _timeInSeconds);
            _tinterp.Start(t1,t2, _timeInSeconds);
            _uinterp.Start(u1, u2, _timeInSeconds);
            _fieldinterp.Start(field1, field2, _timeInSeconds);
            _aspectinterp.Start(aspect1, aspect2, _timeInSeconds);
            _nearinterp.Start(near1, near2, _timeInSeconds);
            _farinterp.Start(far1, far2, _timeInSeconds);
        }