Exemplo n.º 1
0
        public void PointCloudTest()
        {
            List <Vector3> vertices = new List <Vector3>();
            List <Vector3> normals  = new List <Vector3>();
            List <int>     indices  = new List <int>();

            uint[] colours;
            Common.MakeHiResSphere(vertices, indices, normals);

            // Build per vertex colours with colour cycling.
            colours = new uint[vertices.Count];
            for (int i = 0; i < colours.Length; ++i)
            {
                colours[i] = Colour.Cycle(i).Value;
            }

            PointCloud cloud = new PointCloud(1, vertices.Count);

            cloud.AddPoints(vertices);
            cloud.AddNormals(normals);
            cloud.AddColours(colours);

            ShapeTestFramework.CreateShapeFunction create = () => { return(new PointCloudShape()); };
            ShapeTestFramework.TestShape(new PointCloudShape(cloud, 41, 1, 8), create, ValidatePointCloudShape);

            // Run a cloud with an indexed sub-set.
            uint[] indexedSubSet = new uint[vertices.Count / 2];
            for (uint i = 0; i < indexedSubSet.Length; ++i)
            {
                indexedSubSet[i] = i;
            }

            ShapeTestFramework.TestShape(new PointCloudShape(cloud, 41, 1, 8).SetIndices(indexedSubSet), create, ValidatePointCloudShape);
        }