Esempio n. 1
0
        public static Vector3[] LaplacianFilter(Vector3[] vertices, int[] triangles, int times)
        {
            var network = VertexConnection.BuildNetwork(triangles);

            for (int i = 0; i < times; i++)
            {
                vertices = LaplacianFilter(network, vertices, triangles);
            }
            return(vertices);
        }
Esempio n. 2
0
        static Vector3[] HCFilter(Vector3[] vertices, int[] triangles, int times, float alpha, float beta)
        {
            alpha = Mathf.Clamp01(alpha);
            beta  = Mathf.Clamp01(beta);

            var network = VertexConnection.BuildNetwork(triangles);

            Vector3[] origin = new Vector3[vertices.Length];
            Array.Copy(vertices, origin, vertices.Length);
            for (int i = 0; i < times; i++)
            {
                vertices = HCFilter(network, origin, vertices, triangles, alpha, beta);
            }
            return(vertices);
        }