private void tX_Scroll object sender EventArgs Double degrees tX Value

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
private void tX_Scroll(object sender, EventArgs e)
{
Double degrees = tX.Value;
double cDegrees = (Math.PI * degrees) / 180.0f;
double cosDegrees = Math.Cos(cDegrees);
double sinDegrees = Math.Sin(cDegrees);
double y = 0, z = 0;
for (int i = 0; i < list.Count; i++)
{
y = ((list[i].Y - centerPoint.Y) * cosDegrees) + ((list[i].Z - centerPoint.Z) * sinDegrees) + centerPoint.Y;
z = ((list[i].Y - centerPoint.Y) * -sinDegrees) + ((list[i].Z - centerPoint.Z) * cosDegrees) + centerPoint.Z;
list[i] = new Point3D(list[i].X, y, z);
}
pictureBox1.Invalidate();
}
private void tY_Scroll(object sender, EventArgs e)
{
Double degrees = tY.Value;
double cDegrees = (Math.PI * degrees) / 180.0f;
double cosDegrees = Math.Cos(cDegrees);
double sinDegrees = Math.Sin(cDegrees);
double x = 0, z = 0;
for (int i = 0; i < list.Count; i++)
{
x = ((list[i].X - centerPoint.X) * cosDegrees) + ((list[i].Z - centerPoint.Z) * sinDegrees) + centerPoint.X;
z = ((list[i].X - centerPoint.X) * -sinDegrees) + ((list[i].Z - centerPoint.Z) * cosDegrees) + centerPoint.Z;
list[i] = new Point3D(x, list[i].Y, z);
}
pictureBox1.Invalidate();
}
private void tZ_Scroll(object sender, EventArgs e)
{
Double degrees = tZ.Value;
double cDegrees = (Math.PI * degrees) / 180.0f;
double cosDegrees = Math.Cos(cDegrees);
double sinDegrees = Math.Sin(cDegrees);
double y = 0, x = 0;
for (int i = 0; i < list.Count; i++)
{
y = ((list[i].Y - centerPoint.Y) * cosDegrees) + ((list[i].X - centerPoint.X) * sinDegrees) + centerPoint.Y;
x = ((list[i].Y - centerPoint.Y) * -sinDegrees) + ((list[i].X - centerPoint.X) * cosDegrees) + centerPoint.X;
list[i] = new Point3D(x, y, list[i].Z);
}
pictureBox1.Invalidate();
}