GenerateVertexBuffer() 공개 메소드

public GenerateVertexBuffer ( List vertices ) : void
vertices List
리턴 void
예제 #1
0
        public override long Contour(float threshold)
        {
            Stopwatch watch = new Stopwatch();

            watch.Start();
            if (tree == null)
            {
                Vertices.Clear();
                tree = new OctreeNode();
                List <VertexPositionColorNormal> vs = new List <VertexPositionColorNormal>();

                tree.ConstructBase(Resolution, threshold, ref vs);
                tree.ClusterCellBase(threshold);
                //Vertices = vs.ToList();

                tree.GenerateVertexBuffer(Vertices);

                if (Vertices.Count > 0)
                {
                    VertexBuffer.SetData <VertexPositionColorNormal>(Vertices.ToArray());
                }
                VertexCount = Vertices.Count;
            }

            OutlineLocation = 0;
            //ConstructTreeGrid(tree);
            CalculateIndexes(threshold);
            watch.Stop();

            return(watch.ElapsedMilliseconds);
        }
예제 #2
0
파일: MDC3D.cs 프로젝트: Lin20/isosurface
        public override long Contour(float threshold)
        {
            Stopwatch watch = new Stopwatch();

            watch.Start();
            if (tree == null)
            {
                VerticesDN.Clear();
                tree = new OctreeNode();
                List<VertexPositionColorNormalNormal> vs = new List<VertexPositionColorNormalNormal>();

                tree.ConstructBase(Resolution, 0, ref vs);
                tree.ClusterCellBase(0);
                //VerticesDN = vs.ToList();

                tree.GenerateVertexBuffer(VerticesDN);

                if (VerticesDN.Count > 0)
                    VertexBuffer.SetData<VertexPositionColorNormalNormal>(VerticesDN.ToArray());
                VertexCount = VerticesDN.Count;
            }

            OutlineLocation = 0;
            //ConstructTreeGrid(tree);
            CalculateIndexes(threshold);
            watch.Stop();

            return watch.ElapsedMilliseconds;
        }