Changeset 9284 for 2017/30/MikkoH/Sq/Sq/Sq/Sq.cs
 Timestamp:
 20170731 18:07:17 (2 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

2017/30/MikkoH/Sq/Sq/Sq/Sq.cs
r9278 r9284 6 6 { 7 7 List<Vector> ps = new List<Vector>(), crc = new List<Vector>(); 8 double x, y, z, a, fac = Math.Pow(2, 15), rad = 200, radc = 0.02;8 double x, y, z, a, fac = Math.Pow(2, 15), rad = 50, radc = 0.01, mag = 4; 9 9 10 10 public override void Begin() 11 11 { 12 12 Window.Width = 1200; Window.Height = 800; 13 Mouse.IsCursorVisible = true; 13 14 Level.Background.Color = Color.Black; 14 Mouse.IsCursorVisible = true; 15 15 16 16 for (int i = 300; i <= 300; i += 10) ps.Add(new Vector(300, i)); 17 17 for (int i = 300; i <= 300; i += 10) ps.Add(new Vector(i, 300)); … … 19 19 for (int i = 300; i >= 300; i = 10) ps.Add(new Vector(i, 300)); 20 20 21 for (int i = 0; i <= 1 00; i += 1)21 for (int i = 0; i <= 150; i++) 22 22 crc.Add(new Vector(Math.Sin(i) * rad, Math.Cos(i) * rad)); 23 24 //for (int i = 0; i < 100; i++) trans.Add(new Vector(1, 1));25 //for (int i = 0; i < 100; i++) trans.Add(new Vector(1, 1));26 23 } 27 24 … … 29 26 { 30 27 c.BrushColor = Color.Red; 31 //Mouse.PositionOnScreen.Angle.Degrees/1000;32 28 33 29 for (int i = 0; i < ps.Count; i++) 30 { 34 31 c.DrawLine(ps[i % ps.Count], ps[(i + ps.Count / 4) % ps.Count]); 32 ps[i] = Vector.FromLengthAndAngle(ps[i].Magnitude + mag, ps[i].Angle); 33 if (ps[i].Magnitude < 1  ps[i].Magnitude > 200) mag = mag; 34 } 35 35 36 36 c.BrushColor = Color.Blue; … … 39 39 { 40 40 c.DrawLine(crc[i % crc.Count], crc[(i + 2) % crc.Count]); 41 crc[i % crc.Count] = new Vector(Math.Sin(i) * rad, Math.Cos(i) * rad); 42 if (rad > 200  rad < 1) radc = radc; rad = radc; 41 crc[i] = new Vector(Math.Sin(i) * rad, Math.Cos(i) * rad); 42 if (rad < 1  rad > 100) radc = radc; 43 rad = radc; 43 44 } 44 45 45 46 Rotate(ps); Rotate(crc, true); 46 47 Squeeze(ps);48 47 49 48 base.Paint(c); … … 53 52 { 54 53 double d = Time.SinceLastUpdate.TotalSeconds; 55 56 54 if (reverse) d = d; 57 55 for (int i = 0; i < vs.Count; i++) … … 59 57 vs[i].X * Math.Sin(d) + vs[i].Y * Math.Cos(d)); 60 58 } 61 62 void Squeeze(List<Vector> vs)63 {64 //if (ps[0].X > 300) fac = Math.Pow(2, 15);65 //if (ps[ps.Count  1].X < 300) fac = Math.Pow(2, 15);66 67 for (int i = 0; i < vs.Count / 4; i++) vs[i] = new Vector(vs[i].X + (x = fac), vs[i].Y + (y = fac));68 for (int i = vs.Count / 4 * 3; i < vs.Count; i++) vs[i] = new Vector(vs[i].X + (x = fac), vs[i].Y + (y = fac));69 for (int i = vs.Count / 4; i < vs.Count / 2; i++) vs[i] = new Vector(vs[i].X + (z += fac), vs[i].Y + (a += fac));70 for (int i = vs.Count / 2; i < vs.Count / 4 * 3; i++) vs[i] = new Vector (vs[i].X + (z += fac), vs[i].Y + (a += fac));71 }72 59 }
Note: See TracChangeset
for help on using the changeset viewer.