A Vector3f normal with a Single distance from origin.
Пример #1
0
        /// <summary>Get the intersection point between the three planes.</summary>
        public void Intersect(ref Plane3f b, ref Plane3f c, out Vector3f result)
        {
            Vector3f v1, v2, v3;
            Vector3f cross;

            b.Normal.Cross(ref c.Normal, out cross);

            var f = -Normal.Dot(ref cross);

            v1 = cross * Distance;

            c.Normal.Cross(ref Normal, out cross);
            v2 = cross * b.Distance;

            Normal.Cross(ref b.Normal, out cross);
            v3 = cross * c.Distance;

            result.X = (Single)((v1.X + v2.X + v3.X) / f);
            result.Y = (Single)((v1.Y + v2.Y + v3.Y) / f);
            result.Z = (Single)((v1.Z + v2.Z + v3.Z) / f);

            return;
        }
Пример #2
0
        /// <summary>Get the intersection point between the three planes.</summary>
        public void Intersect( ref  Plane3f b,  ref  Plane3f c , out Vector3f result)
        {
            Vector3f v1, v2, v3;
                    Vector3f cross;

                    b.Normal.Cross(ref c.Normal, out cross);

                    var f = -Normal.Dot(ref cross);

                    v1 = cross *  Distance ;

                    c.Normal.Cross(ref Normal, out cross);
                    v2 = cross *  b.Distance ;

                    Normal.Cross(ref b.Normal, out cross);
                    v3 = cross *  c.Distance ;

                    result.X = (Single)( (v1.X + v2.X + v3.X) / f );
                    result.Y = (Single)( (v1.Y + v2.Y + v3.Y) / f );
                    result.Z = (Single)( (v1.Z + v2.Z + v3.Z) / f );

                    return;
        }