Advertisement
Guest User

Untitled

a guest
May 28th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.32 KB | None | 0 0
  1.                  times(U, V, R1);
  2.                  times(R1, T, R);
  3.                  mat3D F3D;
  4.                  frame(Wx, Wy, Wcx, Wcy, F3D);
  5.  
  6.                  System::Collections::Generic::List<polygon3D^> ^processedPolygons = gcnew System::Collections::Generic::List<polygon3D^>;
  7.                  for (int i = 0; i < polygons.Count; i++) {
  8.                     polygon3D^ p  = polygons[i];
  9.                     polygon^  p1 = gcnew polygon(0);
  10.                     polygon3D^ p2  = gcnew polygon3D(0);
  11.                     point3D A;
  12.                     point A1, A2, c;
  13.                     vec3D a, a1;
  14.                     vec a2, a3;
  15.  
  16.                     for (int j = 0; j < p->Count; j++) {
  17.                         point2vec(p[j], a);
  18.                         timesMatVec(R, a, a1);
  19.                         timesMatVec(F3D, a1, a1);
  20.                         vec2point(a1, A);
  21.                         p2->Add(A);
  22.                     }
  23.                     processedPolygons->Add(p2);
  24.                  }
  25.                  if (fill) {
  26.                      Warnock(processedPolygons, Rectangle(Pmin.x + 1, Pmin.y + 1, Wx - 4, Wy - 4), g, colors, Form::BackColor);
  27.                  } else {
  28.                      for (int i = 0; i < processedPolygons->Count; i++) {
  29.                          System::Collections::Generic::List<PointF> ^toDraw = gcnew System::Collections::Generic::List<PointF>;
  30.                          for (int j = 0; j < processedPolygons[i]->Count; j++) {
  31.                              toDraw->Add(PointF(processedPolygons[i][j].x, processedPolygons[i][j].y));
  32.                             }
  33.                          g->DrawPolygon(gcnew Pen(colors[i]), toDraw->ToArray());
  34.                      }
  35.                  }
  36.                  g->DrawString(prOrtho? "Ortho" : "Perspective", textFont, textBrush, Wx - 80, top + 5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement