Нужно, чтобы тетраэдр вращался.
private: System::Void pictureBox1_Click(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
Pen ^mypen = gcnew Pen(Color::Black);
int x0 = pictureBox1→Width / 2;
int y0 = pictureBox1→Height / 2;
Graphics ^gr = pictureBox1→CreateGraphics();
float pi = 3.14,R = 150,r = 100, alfa = -2*pi;
// Point1
int y1 = y0 + R*sin(-(pi / 2));
int x1 = x0 + R*cos(pi/2);
gr→DrawLine(mypen, x0, y0, x1, y1);
//Point2
int x2 = x0 + r*cos(-2 * pi);
int y2 = y0 + r*sin(0);
gr→DrawLine(mypen, x0, y0, x2, y2);
//Point3
int x3 = x0 + r*cos(-(4 * pi / 3));
int y3 = y0 + r*sin(pi / 2);
gr→DrawLine(mypen, x0, y0, x3, y3);
//Grany
gr→DrawLine(mypen, x1, y1, x2, y2);
gr→DrawLine(mypen, x2, y2, x3, y3);
gr→DrawLine(mypen, x3, y3, x1, y1);
Попробовал так не получилось.
for (float i = 0; i < 100; i+=0.1)
{
SolidBrush ^mybrush = gcnew SolidBrush(Color::White);
gr→FillRectangle(mybrush, 0, 0, pictureBox1→Width, pictureBox1→Height);
x2 = x2*cos(alfa) - y2*sin(alfa);
y2 = x2*sin(alfa) + y2 *cos(alfa);
x3 = x3*cos(alfa) - y3*sin(alfa);
y3 = x3*sin(alfa) + y3 *cos(alfa);
gr→DrawLine(mypen, x0, y0, x1, y1);
gr→DrawLine(mypen, x0, y0, x2, y2);
gr→DrawLine(mypen, x0, y0, x3, y3);
gr→DrawLine(mypen, x1, y1, x2, y2);
gr→DrawLine(mypen, x2, y2, x3, y3);
gr→DrawLine(mypen, x3, y3, x1, y1);