Changeset 9240


Ignore:
Timestamp:
2017-07-28 14:33:58 (2 years ago)
Author:
mianhayr
Message:
 
Location:
2017/30/MikkoH/Sq
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 2017/30/MikkoH/Sq/Sq/Sq/Sq.cs

    r9236 r9240  
    66{ 
    77    List<Vector> ps = new List<Vector>(); 
    8     double x, y, z, a, fac = 0.01; 
     8    double x, y, z, a, fac = Math.Pow(2, -10); 
    99 
    1010    public override void Begin() 
     
    1717        for (int i = 300; i > -300; i -= 10) ps.Add(new Vector(300, i)); 
    1818        for (int i = 300; i > -300; i -= 10) ps.Add(new Vector(i, -300)); 
    19          
    2019    } 
    2120 
     
    2625            c.DrawLine(ps[i % ps.Count], ps[(i + ps.Count / 4) % ps.Count]); 
    2726 
     27        if (ps[0].X > -300) fac = Math.Pow(2, -10); 
     28        if (ps[ps.Count-1].X < -300) fac = -Math.Pow(2, -10); 
     29 
    2830        for (int i = 0; i < ps.Count/4; i++) ps[i] = new Vector(ps[i].X + (x -= fac), ps[i].Y + (y -= fac)); 
    2931        for (int i = ps.Count / 4 * 3; i < ps.Count; i++) ps[i] = new Vector(ps[i].X + (x -= fac), ps[i].Y + (y -= fac)); 
    30         for (int i = ps.Count / 4; i < ps.Count / 2; i++) ps[i] = new Vector(ps[i].X + (z += fac), ps[i].Y + (a += fac)); 
    31         for (int i = ps.Count / 2; i < ps.Count / 4 * 3; i++) ps[i] = new Vector(ps[i].X + (z += fac), ps[i].Y + (a += fac)); 
     32        for (int i = ps.Count / 4; i < ps.Count / 2; i++) ps[i] = new Vector(ps[i].X + (z += fac) % 50, ps[i].Y + (a += fac) % 50); 
     33        for (int i = ps.Count / 2; i < ps.Count / 4 * 3; i++) ps[i] = new Vector(ps[i].X + (z += fac) % 50, ps[i].Y + (a += fac) % 50); 
    3234 
    3335        base.Paint(c); 
Note: See TracChangeset for help on using the changeset viewer.