private void comboBox1_SelectedIn dexChanged object sender EventArgs s

 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
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (comboBox1.SelectedIndex)
{
case 0:
points = new Point3D[4];
points[0] = new Point3D(250, 150, 400);
points[1] = new Point3D(250, 350, 400);
points[2] = new Point3D(450, 350, 200);
points[3] = new Point3D(450, 150, 200);
newGraphics.Clear(Color.White);
draw_rectangle();
break;
case 1:
points = new Point3D[8];
points[0] = new Point3D(250, 150, 400);
points[1] = new Point3D(250, 350, 400);
points[2] = new Point3D(450, 350, 200);
points[3] = new Point3D(450, 150, 200);
points[4] = new Point3D(50, 150, 400);
points[5] = new Point3D(50, 350, 400);
points[6] = new Point3D(250, 350, 200);
points[7] = new Point3D(250, 150, 200);
double N = 0.66;
for (int i = 0; i < 8; i++)
{
points[i] = new Point3D((int)(points[i].X * N), (int)(points[i].Y * N), (int)(points[i].Z * N));
}
newGraphics.Clear(Color.White);
draw_cube();
break;
}
}