Пример #1
0
        public static RenderObject FaceLumptoVertex(FaceLump face)
        {
            List <Vertex> vertices = new List <Vertex>();

            for (int i = 0; i < face.edgesContained.Count; i++)
            {
                if (i == 0)
                {
                    vertices.AddRange(EdgeToVertices(face.edgesContained[i], face.plane.normal));
                }
                else
                {
                    vertices.Add(EdgeToVertices(face.edgesContained[i], face.plane.normal)[1]);
                }
            }

            return(new RenderObject(vertices.ToArray()));
        }
Пример #2
0
        private static void ReadFaceLump()
        {
            Console.WriteLine("\n\n-----FACES-----");
            Console.WriteLine("Lump offset: {0}", FACES.fileOffset);
            Console.WriteLine("Lump length: {0}", FACES.fileLength);
            Console.WriteLine("Lump version: {0}\n", FACES.version);

            FaceLump tempFaceLump = new FaceLump();

            byte[] tempByte = new byte[56];

            for (int i = 0; i < FACES.fileLength;)
            {
                Array.Copy(FACES.data, i, tempByte, 0, 56);                 //Copy 56 bytes to tempbytearray

                tempFaceLump.FillLump(tempByte);

                faceList.Add(tempFaceLump);
                //Console.WriteLine(tempFaceLump.plane.dist);
                //Console.WriteLine(tempFaceLump.plane.normal);
                i += 56;
            }
        }