private IEnumerable <IColourSampler> SpinAnimation(BaseCamera camera, SceneNode spinnable, int frames = 16) { var increment = 360.0 / (frames + 1); for (var i = 0; i <= frames; i++) { spinnable.Rotate(Vec3.K, Angle.Deg2Rad * increment); if (spinnable.Scene != null) { camera.Render(spinnable.Scene); } yield return(camera.PixelBuffer.GetSampler()); } }
private IEnumerable <IColourSampler> PongAnimation(BaseCamera camera1, SceneNode pong, int frames) { var dt = (frames + 1) / (2 * Math.PI); var time = 0.0; for (var i = 0; i <= frames; i++) { var x = Math.Sin(time); time += dt; pong.Transform = Transformation.Offset(new Vec3(x, 0, 0)); if (pong.Scene != null) { camera1.Render(pong.Scene); } yield return(camera1.PixelBuffer.GetSampler()); } }