/// <summary> /// Initializes a new instance of the DepthStreamRenderer class. /// </summary> /// <param name="game">The related game object.</param> public DepthStreamRenderer(Game game) : base(game) { this.skeletonStream = new SkeletonStreamRenderer(game, this.SkeletonToDepthMap); this.Size = new Vector2(160, 120); this.bagAnimator = new BagRender(game); }
/// <summary> /// Initializes a new instance of the DepthStreamRenderer class. /// </summary> /// <param name="game">The related game object.</param> public DepthStreamRenderer(Game game) : base(game) { this.skeletonStream = new SkeletonStreamRenderer(game, this.SkeletonToDepthMap); this.Size = new Vector2(160, 120); }
/// <summary> /// Initializes a new instance of the ColorStreamRenderer class. /// </summary> /// <param name="game">The related game object.</param> public ColorStreamRenderer(Game game) : base(game) { this.skeletonStream = new SkeletonStreamRenderer(game, this.SkeletonToColorMap); }
/// <summary> /// Initializes a new instance of the XnaBasics class. /// </summary> public VirtualTryonGame() { this.IsFixedTimeStep = false; this.IsMouseVisible = true; this.Window.Title = "Virtual Tryon System"; this.Window.AllowUserResizing = true; Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; Height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height; // This sets the width to the desired width // It also forces a 4:3 ratio for height // Adds 110 for header/footer this.graphics = new GraphicsDeviceManager(this); this.graphics.PreferredBackBufferWidth = Width; //this.graphics.PreferredBackBufferHeight = ((Width / 4) * 3) + 110; this.graphics.PreferredBackBufferHeight = Height; this.graphics.PreparingDeviceSettings += this.GraphicsDevicePreparingDeviceSettings; this.graphics.SynchronizeWithVerticalRetrace = true; //this.viewPortRectangle = new Rectangle(10, 80, Width - 20, ((Width - 2) / 4) * 3); this.viewPortRectangle = new Rectangle(0, 0, Width, Height); this.graphics.IsFullScreen = false; this.IsMouseVisible = false; physicSystem = new PhysicsSystem(); Content.RootDirectory = "Content"; // The Kinect sensor will use 640x480 for both streams // To make your app handle multiple Kinects and other scenarios, // it is recommended to use KinectSensorChooser provided in Microsoft.Kinect.Toolkit this.chooser = new KinectChooser(this, ColorImageFormat.RgbResolution640x480Fps30, DepthImageFormat.Resolution640x480Fps30); this.Services.AddService(typeof(KinectChooser), this.chooser); // Default size is the full viewport this.colorStream = new ColorStreamRenderer(this); this.colorSmallPosition = new Vector2(15, 10); this.Components.Add(this.chooser); this.clothRender = new ClothRender(this); this.Components.Add(this.clothRender); this.skeletonStream = new SkeletonStreamRenderer(this,null); this.Components.Add(this.skeletonStream); }