private static KeyValuePair <Point, bool> Calculate2DPoint(Viewport3D viewport, Matrix3D cameraToObject, Matrix3D worldToObject, Matrix matrix, Point3D point3D) { double num = 0.0; ProjectionCamera projectionCamera = viewport.Camera as ProjectionCamera; if (projectionCamera != null) { num = projectionCamera.NearPlaneDistance; } if (cameraToObject.Transform(point3D).Z > -num - 1E-06) { return(new KeyValuePair <Point, bool>(new Point(), false)); } return(new KeyValuePair <Point, bool>(matrix.Transform(AdornedToolBehavior3D.Point3DInViewport3D(viewport, worldToObject, point3D)), true)); }