Ejemplo n.º 1
0
        void Lathe(Spine spine, Spine spineTop)
        {
            if (spine.SpinePoints.Count != spineTop.SpinePoints.Count)
            {
                throw new UnityException(string.Format("Unequal number of points between spine 1 ({0}) and spine 2 ({1})",
                                                       spine.SpinePoints.Count, spineTop.SpinePoints.Count));
            }

            MeshPoint lastSpinePoint    = MeshPoint.Null;
            MeshPoint lastTopSpinePoint = MeshPoint.Null;

            for (int i = 0; i < spine.MeshPoints.Count; ++i)
            {
                MeshPoint spinePoint    = spine.MeshPoints [i];
                MeshPoint topSpinePoint = spineTop.MeshPoints [i];

                if (i > 0)
                {
                    MakeQuad(lastSpinePoint, spinePoint, lastTopSpinePoint, topSpinePoint);
                }
                lastSpinePoint    = spinePoint;
                lastTopSpinePoint = topSpinePoint;
            }

            MakeMesh();

            Debug.Log("Making Trails");

            //SpineToVectorLine ("trail 1", ref trail, spine.SpinePoints.ToArray (), Color.white);
            //SpineToVectorLine ("trail 2", ref trail2, spineTop.SpinePoints.ToArray (), Color.red);
        }
Ejemplo n.º 2
0
        void Lathe(Spine spine, Spine spineTop)
        {
            if (spine.SpinePoints.Count != spineTop.SpinePoints.Count)
                                throw new UnityException (string.Format ("Unequal number of points between spine 1 ({0}) and spine 2 ({1})",
                                                         spine.SpinePoints.Count, spineTop.SpinePoints.Count));

                        MeshPoint lastSpinePoint = MeshPoint.Null;
                        MeshPoint lastTopSpinePoint = MeshPoint.Null;

                        for (int i = 0; i < spine.MeshPoints.Count; ++i) {

                                MeshPoint spinePoint = spine.MeshPoints [i];
                                MeshPoint topSpinePoint = spineTop.MeshPoints [i];

                                if (i > 0) {
                                        MakeQuad (lastSpinePoint, spinePoint, lastTopSpinePoint, topSpinePoint);
                                }
                                lastSpinePoint = spinePoint;
                                lastTopSpinePoint = topSpinePoint;
                        }

                        MakeMesh ();

                        Debug.Log ("Making Trails");

                        //SpineToVectorLine ("trail 1", ref trail, spine.SpinePoints.ToArray (), Color.white);
                        //SpineToVectorLine ("trail 2", ref trail2, spineTop.SpinePoints.ToArray (), Color.red);
        }
Ejemplo n.º 3
0
        void ReMesh()
        {
            Clear();
            Spine spine = new Spine(SpinePoints);

            spine.AddPoints(this, 0);
            for (int i = 0; i < VCOUNT; ++i)
            {
                Spine spine2 = spine.OffsetClone(AURORA_HEIGHT * MyCamera.transform.up);
                spine2.AddPoints(this, 1);
                Lathe(spine, spine2);
                spine = spine2;
            }
        }
Ejemplo n.º 4
0
 void ReMesh()
 {
     Clear ();
                 Spine spine = new Spine (SpinePoints);
                 spine.AddPoints (this, 0);
                 for (int i = 0; i < VCOUNT; ++i) {
                         Spine spine2 = spine.OffsetClone (AURORA_HEIGHT * MyCamera.transform.up);
                         spine2.AddPoints (this, 1);
                         Lathe (spine, spine2);
                         spine = spine2;
                 }
 }