Isosurface.AdaptiveDualContouring.OctreeNode.Build C# (CSharp) Method

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
        public int Build(Vector3 min, int size, float threshold, List<VertexPositionColorNormal> vertices, int grid_size)
        {
            this.position = min;
            this.size = size;
            this.type = OctreeNodeType.Internal;
            int v_index = 0;
            ConstructNodes(vertices, grid_size, 1);
            Simplify(threshold, false);
            return v_index;
        }

Usage Example

コード例 #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);
        }
All Usage Examples Of Isosurface.AdaptiveDualContouring.OctreeNode::Build