Build() public method

public Build ( Vector3 min, int size, float threshold, List vertices, int grid_size ) : int
min Vector3
size int
threshold float
vertices List
grid_size int
return int
Esempio n. 1
0
        public override long Contour(float threshold)
        {
            Stopwatch watch = new Stopwatch();

            Vertices.Clear();
            tree = new OctreeNode();

            watch.Start();
            tree.Build(Vector3.Zero, Resolution, threshold, Vertices, Size);

            tree.GenerateVertexBuffer(Vertices);
            if (Vertices.Count > 0)
            {
                VertexBuffer.SetData <VertexPositionColorNormal>(Vertices.ToArray());
            }
            VertexCount = Vertices.Count;
            //ConstructTreeGrid(tree);
            CalculateIndexes();
            watch.Stop();

            return(watch.ElapsedMilliseconds);
        }
Esempio n. 2
0
        public override long Contour(float threshold)
        {
            Stopwatch watch = new Stopwatch();

            Vertices.Clear();
            tree = new OctreeNode();

            watch.Start();
            tree.Build(Vector3.Zero, Resolution, threshold, Vertices, Size);

            tree.GenerateVertexBuffer(Vertices);
            if (Vertices.Count > 0)
                VertexBuffer.SetData<VertexPositionColorNormal>(Vertices.ToArray());
            VertexCount = Vertices.Count;
            //ConstructTreeGrid(tree);
            CalculateIndexes();
            watch.Stop();

            return watch.ElapsedMilliseconds;
        }