PlaneIntersection() public method

Finds the intersection with a plane.
public PlaneIntersection ( System.Windows.Media.Media3D.Point3D position, System.Windows.Media.Media3D.Vector3D normal ) : Point3D?
position System.Windows.Media.Media3D.Point3D /// A point on the plane. ///
normal System.Windows.Media.Media3D.Vector3D /// The normal of the plane. ///
return Point3D?
        /// <summary>
        /// Unproject a point from the screen (2D) to a point on plane (3D)
        /// </summary>
        /// <param name="p">
        /// The 2D point.
        /// </param>
        /// <param name="position">
        /// plane position
        /// </param>
        /// <param name="normal">
        /// plane normal
        /// </param>
        /// <returns>
        /// A 3D point.
        /// </returns>
        public Point3D?UnProject(Point p, Point3D position, Vector3D normal)
        {
            Ray3D ray = this.GetRay(p);

            if (ray == null)
            {
                return(null);
            }

            return(ray.PlaneIntersection(position, normal));
        }
        /// <summary>
        /// Un projects a point from the screen (2D) to a point on plane (3D)
        /// </summary>
        /// <param name="p">
        /// The 2D point.
        /// </param>
        /// <param name="position">
        /// A point on the plane .
        /// </param>
        /// <param name="normal">
        /// The plane normal.
        /// </param>
        /// <returns>
        /// A 3D point.
        /// </returns>
        public Point3D? UnProject(Point p, Point3D position, Vector3D normal)
        {
            Ray3D ray = this.GetRay(p);
            if (ray == null)
            {
                return null;
            }

            Point3D i;
            return ray.PlaneIntersection(position, normal, out i) ? (Point3D?)i : null;
        }
示例#3
0
        /// <summary>
        /// Unproject a point from the screen (2D) to a point on plane (3D)
        /// </summary>
        /// <param name="viewport">
        /// The viewport.
        /// </param>
        /// <param name="p">
        /// The 2D point.
        /// </param>
        /// <param name="position">
        /// plane position
        /// </param>
        /// <param name="normal">
        /// plane normal
        /// </param>
        /// <returns>
        /// A 3D point.
        /// </returns>
        /// <remarks>
        /// Map window coordinates to object coordinates like gluUnProject.
        /// </remarks>
        public static Point3D?UnProject(Viewport3D viewport, Point p, Point3D position, Vector3D normal)
        {
            Ray3D ray = GetRay(viewport, p);

            if (ray == null)
            {
                return(null);
            }

            return(ray.PlaneIntersection(position, normal));
        }