Ejemplo n.º 1
0
        public void Update(GameTime time)
        {
            EffectParams.InvView = Matrix.Invert(camera.ViewMatrix);
            //Matrix view = camera.ViewMatrix;

            //view = Matrix.RotationY(MathEx.PiOver4) * view;
            Matrix view = Matrix.RotationY(-MathEx.PIf / 6) * EffectParams.InvView;

            EffectParams.LightDir = -view.Forward;

            renderer.Update(time);
        }
Ejemplo n.º 2
0
        public void Update(GameTime time)
        {
            renderer.Update(time);

            XI.MouseState mstate = XI.Mouse.GetState();

            camera.ChaseDirection        = new Vector3((float)Math.Cos(xang), -(float)Math.Sin(yang), (float)Math.Sin(xang));
            camera.DesiredPositionOffset = new Vector3(0, 0, distance);

            distance -= 0.05f * (mstate.ScrollWheelValue - lastState.ScrollWheelValue);
            if (mstate.RightButton == XI.ButtonState.Pressed)
            {
                xang += MathEx.Degree2Radian(mstate.X - lastState.X) * 0.5f;
                yang += MathEx.Degree2Radian(mstate.Y - lastState.Y) * 0.5f;
            }
            else if (mstate.LeftButton == XI.ButtonState.Pressed)
            {
                //obj.Orientation *= Matrix.RotationY(MathEx.Degree2Radian(mstate.X - lastState.X) * 0.5f);
            }

            lastState = mstate;
        }