コード例 #1
0
        static void ConvertOBJtoCL(string InputFile)
        {
            Console.WriteLine("Reading" + InputFile);

            UseHeader = new Header();
            QuadNodeList.Clear();
            TriangleList.Clear();
            VertexList.Clear();

            byte DepthLevel = 11;
            bool AutoDepth;

            Console.WriteLine("Please choose a depth level for the quadtree. It depends on how large/complex your model is.");
            Console.WriteLine("The maximum you should use is 10. Type 0 for it to be chosen automatically.");

            while (DepthLevel < 0 | DepthLevel > 10)
            {
                DepthLevel = Convert.ToByte(Console.ReadLine());
            }

            if (DepthLevel == 0)
            {
                AutoDepth = true;
            }
            else
            {
                AutoDepth = false;
            }

            if (ReadOBJFile(InputFile))
            {
                if (GenerateCollision(AutoDepth, DepthLevel))
                {
                    CreateCLFile(InputFile);
                }
                else
                {
                    Console.WriteLine("Error.");
                }
            }
            else
            {
                Console.WriteLine("Error.");
            }
        }
コード例 #2
0
 public void ClearTriangles()
 {
     TriangleList.Clear();
 }