Exemple #1
0
        public GLVector CrossProduct()
        {
            if (Points.Count < 3)
            {
                return(new GLVector());
            }

            var u = new GLVector(Points[0], Points[1]);
            var v = new GLVector(Points[1], Points[2]);

            return(GLVector.CrossProduct(u, v));
        }
Exemple #2
0
        public static GLPlane CreateFromVectorsAndPoint(GLVector u, GLVector v, GLPoint P)
        {
            var plane = new GLPlane();

            plane.Name = "plane";

            plane.Position = P;

            var n = GLVector.CrossProduct(u, v);

            plane.NormalVector = n;

            plane.D = -n.X * P.X - n.Y * P.Y - n.Z * P.Z;

            return(plane);
        }