Exemplo n.º 1
0
        private void CreateChildren()
        {
            Transform thisTransform = transform;
            int       childCount    = thisTransform.childCount;

            Vector3[] points = new Vector3[childCount];
            for (int i = 0; i < childCount; ++i)
            {
                points[i] = thisTransform.GetChild(i).position.ToVector2XY();
            }
            CatmullRomSpline3.Create(points, SplineTypes.Open);
        }
Exemplo n.º 2
0
        private void CreateSpiral()
        {
            CatmullRomSpline3 spline = CatmullRomSpline3.Create();
            int points = 1000;

            for (int i = 0; i < points; ++i)
            {
                float   t = i * .1f;
                Vector3 p = .5f * new Vector3(t * Mathf.Cos(t), .5f * t, t * Mathf.Sin(t));
                spline.AddVertexLast(p);
            }
        }
Exemplo n.º 3
0
 private void CreateEmpty()
 {
     CatmullRomSpline3.Create();
 }