示例#1
0
        /// <summary>
        /// Gets the ray value.
        /// </summary>
        public Point3D GetRayValue(Point3D ptNear, Point3D ptFar, double zValue)
        {
            LinearTransform t = new LinearTransform();

            t.Init(ptNear.Z, ptFar.Z, 0, 1);
            double f = t.Transform(zValue);

            t.Init(0, 1, ptNear.X, ptFar.X);
            double x = t.Transform(f);

            t.Init(0, 1, ptNear.Y, ptFar.Y);
            double y = t.Transform(f);

            return(new Point3D(x, y, zValue));
        }
        public Matrix3D GetMatrix(double t)
        {
            Matrix3D m = new Matrix3D();

            m.M11 = t11.Transform(t);
            m.M12 = t12.Transform(t);
            m.M13 = t13.Transform(t);
            m.M14 = t14.Transform(t);

            m.M21 = t21.Transform(t);
            m.M22 = t22.Transform(t);
            m.M23 = t23.Transform(t);
            m.M24 = t24.Transform(t);

            m.M31 = t31.Transform(t);
            m.M32 = t32.Transform(t);
            m.M33 = t33.Transform(t);
            m.M34 = t34.Transform(t);

            m.M44 = t44.Transform(t);

            m.OffsetX = ox.Transform(t);
            m.OffsetY = oy.Transform(t);
            m.OffsetZ = oz.Transform(t);

            return(m);
        }
示例#3
0
 public Point Transform(double x, double y)
 {
     return(new Point(Clamp(tx.Transform(x), 0, 1), Clamp(ty.Transform(y), 0, 1)));
 }
示例#4
0
 public Point Transform(double x, double y)
 {
     return(new Point(MathUtils.Clamp(tx.Transform(x), 0, 1), MathUtils.Clamp(ty.Transform(y), 0, 1)));
 }
示例#5
0
        /// <summary>
        /// Gets the ray value.
        /// </summary>
        public Point3D GetRayValue(Point3D ptNear, Point3D ptFar, double zValue)
        {
            LinearTransform t = new LinearTransform();
            t.Init(ptNear.Z, ptFar.Z, 0, 1);
            double f = t.Transform(zValue);

            t.Init(0, 1, ptNear.X, ptFar.X);
            double x = t.Transform(f);

            t.Init(0, 1, ptNear.Y, ptFar.Y);
            double y = t.Transform(f);

            return new Point3D(x, y, zValue);
        }