Exemplo n.º 1
0
        //============================================================
        public void Update()
        {
            Vector3 position = new Vector3(_position.X, _position.Y, _position.Z);
            Vector3 target   = new Vector3(_target.X, _target.Y, _target.Z);

            _matrix.AssignNative(DxMatrix.LookAtLH(position, target, Vector3.UnitY));
        }
Exemplo n.º 2
0
        public TopViewCamera(Frame3D loc, double aspectRatio) : base(aspectRatio)
        {
            Vector3 vec = loc.ToDirectXVector();

            _topViewTransform = Matrix.LookAtLH(new Vector3(0, 0, vec.Z),
                                                new Vector3(), Vector3.UnitY);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Создает камеру с видом от первого лица
 /// </summary>
 /// <param name="source">Тело, к которому привязана камера</param>
 /// <param name="offset">Смещение камеры относительно Location тела</param>
 /// <param name="viewAngle"> </param>
 /// <param name="aspectRatio"> </param>
 public FirstPersonCamera(Body source, Frame3D offset,
                          Angle viewAngle, double aspectRatio) : base(aspectRatio)
 {
     _source             = source;
     _offset             = offset;
     ViewAngle           = viewAngle;
     _defaultWorldMatrix = Matrix.LookAtLH(Vector3.Zero, new Vector3(-1, 0, 0), UpVector);
 }
Exemplo n.º 4
0
        public override void UpdateView()
        {
            FreeLook freelook = Demo.Freelook;

            Device.SetTransform(TransformState.View, Matrix.LookAtLH(MathHelper.Convert(freelook.Eye), MathHelper.Convert(freelook.Target), MathHelper.Convert(freelook.Up)));
        }