예제 #1
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));
        }
예제 #2
0
        public Ray3D TransformToCoordSys(Ray3D r)
        {
            var p  = r.ThroughPoint;
            var uv = r.Direction;

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

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