private void init(IScreen IScreen) { this.IScreen = IScreen; _aspectRatio = IScreen.GraphicInfo.Viewport.AspectRatio; _projection = Matrix.CreatePerspectiveFieldOfView(_fieldOdView, _aspectRatio, _nearPlane, _farPlane); this._frustrum = new BoundingFrustum(_view * _projection); { IScreen.BindInput(new SimpleConcreteGestureInputPlayable(Microsoft.Xna.Framework.Input.Touch.GestureType.FreeDrag, (sample) => { this.RotationInY += sample.Delta.Y * 0.001f; this.RotationInX += sample.Delta.X * 0.001f; } )); IScreen.BindInput(new SimpleConcreteGestureInputPlayable(Microsoft.Xna.Framework.Input.Touch.GestureType.Pinch, (sample) => { // if (lastDistance != 0) { // get the current and previous locations of the two fingers Vector2 a = sample.Position; Vector2 aOld = sample.Position - sample.Delta; Vector2 b = sample.Position2; Vector2 bOld = sample.Position2 - sample.Delta2; // figure out the distance between the current and previous locations float d = Vector2.Distance(a, b); float dOld = Vector2.Distance(aOld, bOld); // calculate the difference between the two and use that to alter the scale float scaleChange = (d - dOld) * .5f; this.Radius -= scaleChange; //cam.AspectRatio = GraphicInfo.BackBufferWidth / GraphicInfo.BackBufferHeight; //float dist = (sample.Position - sample.Position2).Length(); //CameraUpdate.Radius += (dist - lastDistance) * 0.5f; //lastDistance = dist; } } )); } }