protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); spaceship = new GameModel(Content.Load <Model>("spaceship")) { Position = new Vector3(0, 400, -1000), Scale = new Vector3(50f), }; var list = new ModelAnimationKeyframeList(spaceship.Position, spaceship.Rotation) .Translate(dz: 1600) .Rotate(dy: MathHelper.PiOver2) .Translate(dx: 1600) .Rotate(dy: MathHelper.PiOver2) .Translate(dz: -1600) .Rotate(dy: MathHelper.PiOver2) .Translate(dx: -1600) .Rotate(dy: MathHelper.PiOver2); animation = new KeyframedModelAnimation( list, true, false); models.Add(spaceship); models.Add(Content.Load <Model>("ground")); var d = 2000; camera = new FixedCamera( new Vector3(-d, d, -d), Vector3.Zero, GraphicsDevice); }
public KeyframedModelAnimation( ModelAnimationKeyframeList frames, bool looping = true, bool autoreverse = true ) { this.Frames = frames; this.Looping = looping; this.ElapsedTime = TimeSpan.FromSeconds(0); this.AutoReverse = autoreverse; }