/// <summary>
        /// Transforms a ray according to the inverse of this change matrix
        /// </summary>
        /// <param name="r">a ray</param>
        /// <returns>a transformed ray</returns>
        public Ray3D TransformFromCoordSys(Ray3D r)
        {
            var p  = r.ThroughPoint;
            var uv = r.Direction;

            // The position and the vector are transformed
            var point     = this.BaseChangeMatrix.Invert().Transform(p) + this.OffsetToBase;
            var direction = this.BaseChangeMatrix.Invert().Transform(uv);

            return(new Ray3D(point, direction));
        }
Beispiel #2
0
        public Ray3D TransformFromCoordSys(Ray3D r)
        {
            var p  = r.ThroughPoint;
            var uv = r.Direction;

            // positionen och vektorn transformeras
            var point     = this.BaseChangeMatrix.Invert().Transform(p) + this.OffsetToBase;
            var direction = this.BaseChangeMatrix.Invert().Transform(uv);

            return(new Ray3D(point, direction));
        }
        /// <summary>
        /// Transforms a ray according to this change matrix
        /// </summary>
        /// <param name="r">a ray</param>
        /// <returns>a transformed ray</returns>
        public Ray3D TransformToCoordSys(Ray3D r)
        {
            var p  = r.ThroughPoint;
            var uv = r.Direction;

            // The position and the vector are transformed
            var baseChangeMatrix = this.BaseChangeMatrix;
            var point            = baseChangeMatrix.Transform(p) + this.OffsetToBase;
            var direction        = uv.TransformBy(baseChangeMatrix);

            return(new Ray3D(point, direction));
        }
 public static Point3D IntersectionOf(Plane plane, Ray3D ray)
 {
     return(plane.IntersectionWith(ray));
 }
 /// <summary>
 /// Transforms a ray and returns the transformed.
 /// </summary>
 /// <param name="ray">A ray</param>
 /// <returns>A transformed ray</returns>
 public Ray3D Transform(Ray3D ray)
 {
     return(new Ray3D(this.Transform(ray.ThroughPoint), this.Transform(ray.Direction)));
 }