protected override void OnLoad(EventArgs e) { base.OnLoad(e); // cache location etc for when we come out of fullscreen windowedLocation = Location; windowedSize = Size; // pick up view and projection for projector view = new SharpDX.Matrix(); for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { view[i, j] = (float)projector.pose[i, j]; } } view.Invert(); view.Transpose(); var cameraMatrix = projector.cameraMatrix; float fx = (float)cameraMatrix[0, 0]; float fy = (float)cameraMatrix[1, 1]; float cx = (float)cameraMatrix[0, 2]; float cy = (float)cameraMatrix[1, 2]; float near = 0.1f; float far = 100.0f; float w = projector.width; float h = projector.height; projection = ProjectionMappingSample.ProjectionMatrixFromCameraMatrix(fx, fy, cx, cy, w, h, near, far); projection.Transpose(); }
public Skeleton(ProjectionMappingSample.ProjectionFeedback feedback, IReadOnlyDictionary<JointType, Kinect2SJoint> joints, IDictionary<JointType, System.Drawing.Point> jointPoints, Pen drawingPen) { this.Feedback = feedback; this.Joints = joints; this.JointPoints = jointPoints; this.DrawingPen = drawingPen; }