Exemplo n.º 1
0
        /// <summary>
        /// Get the ray into the view volume given by the position in 2D (screen coordinates)
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        public Ray3D GetRay(Point position)
        {
            Point3D point1, point2;
            bool    ok = Viewport3DHelper.Point2DtoPoint3D(Viewport, position, out point1, out point2);

            if (!ok)
            {
                return(null);
            }

            return(new Ray3D {
                Origin = point1, Direction = point2 - point1
            });
        }