Beispiel #1
0
        public void Tesselate(float resolution, Storage.Builders.ITriangleBuilder3f builder)
        {
            if (resolution < 0.0f ||
                (resolution > SideA && resolution > SideB && resolution > SideC && resolution > SideD))
            {
                if (builder.IsIndexed)
                {
                    // We simply append vertices and proceed.
                    uint indexBase = builder.AddControlPoints(A, B, C, D);

                    // Add vertices if indexed

                    builder.AddIndexedTriangles(
                        new uint[] { indexBase, indexBase + 1, indexBase + 2,
                                     indexBase, indexBase + 2, indexBase + 3 }
                        );
                }
                else
                {
                    // We need to pust 2 triangles.
                    builder.AddControlPoints(A, B, C, A, C, D);
                }
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Beispiel #2
0
        public void Tesselate(float resolution, Storage.Builders.ITriangleBuilder3f builder)
        {
            // Adaptive same as normal
            if (resolution < 0)
            {
                resolution = -resolution;
            }

            throw new NotImplementedException();
        }
        public void Tesselate(float resolution, Storage.Builders.ITriangleBuilder3f builder)
        {
            // We create a special line builder that will create contours.
            ContourBuilder contourBuilder = new ContourBuilder();

            Sample(resolution, contourBuilder);

            // We now invoke the algorithm.
            Algorithms.PolygonTesselation.Tesselate(contourBuilder.Contours, builder);
        }
Beispiel #4
0
        public void Tesselate(float resolution, Storage.Builders.ITriangleBuilder3f builder)
        {
            Vector3f[] points = this.ConvertToList(resolution);

            // We now tesselate points.
            List <Vector3f[]> polygons = new List <Vector3f[]>();

            polygons.Add(points);

            Algorithms.PolygonTesselation.Tesselate(polygons, builder);
        }
Beispiel #5
0
        public void Tesselate(float resolution, Storage.Builders.ITriangleBuilder3f builder)
        {
            if (resolution < 0.0f ||
                (resolution > SideX && resolution > SideX && resolution > SideX))
            {
                if (!builder.IsIndexed)
                {
                    // Non indexed really isnt the best practice here ...
                    throw new NotImplementedException();
                }
                else
                {
                    // We simply append vertices and proceed.
                    uint indexBase = builder.AddControlPoints(
                        new Vector3f(Min.X, Min.Y, Min.Z),
                        new Vector3f(Max.X, Min.Y, Min.Z),
                        new Vector3f(Max.X, Min.Y, Max.Z),
                        new Vector3f(Min.X, Min.Y, Max.Z),
                        new Vector3f(Min.X, Max.Y, Min.Z),
                        new Vector3f(Max.X, Max.Y, Min.Z),
                        new Vector3f(Max.X, Max.Y, Max.Z),
                        new Vector3f(Min.X, Max.Y, Max.Z));

                    // We also need indices if indexed.

                    builder.AddIndexedTriangles(
                        new uint[] {
                        indexBase, indexBase + 1, indexBase + 2,
                        indexBase, indexBase + 2, indexBase + 3,
                        indexBase, indexBase + 5, indexBase + 1,
                        indexBase, indexBase + 4, indexBase + 5,
                        indexBase + 1, indexBase + 6, indexBase + 2,
                        indexBase + 1, indexBase + 5, indexBase + 6,
                        indexBase, indexBase + 3, indexBase + 7,
                        indexBase, indexBase + 7, indexBase + 4,
                        indexBase + 3, indexBase + 2, indexBase + 6,
                        indexBase + 3, indexBase + 6, indexBase + 7,
                        indexBase + 4, indexBase + 6, indexBase + 5,
                        indexBase + 4, indexBase + 7, indexBase + 6
                    }
                        );
                }
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Beispiel #6
0
 public void Tesselate(float resolution, Storage.Builders.ITriangleBuilder3f builder)
 {
     throw new NotImplementedException();
 }