//Her tegner vi et wireframe private void DrawLines(WindowsForms canvas, Color color) { if (properties.displayLines) { foreach (var polyLine in polyLines) { //Loop through polyline for (int i = 0; i < polyLine.indexesInModel.Length - 1; i++) { //Draw line canvas.DrawLineAt(color, calc2DPoints[polyLine.indexesInModel[i]], calc2DPoints[polyLine.indexesInModel[i + 1]]); } } } if (properties.displayFaces) { foreach (var face in faces) { //Loop through polyline in face for (int i = 0; i < face.indexesInModel.Length - 1; i++) { //Draw line canvas.DrawLineAt(color, calc2DPoints[face.indexesInModel[i]], calc2DPoints[face.indexesInModel[i + 1]]); } //Draw last line canvas.DrawLineAt(color, calc2DPoints[face.indexesInModel[0]], calc2DPoints[face.indexesInModel[face.indexesInModel.Length - 1]]); } } }
private void DrawPoints(WindowsForms canvas, Color color) { if (properties.displayPoints) { canvas.DrawAt(color, calc2DPoints); } }
public void Draw(WindowsForms canvas, Color colorPoints, Color colorLines) { //Tegner rotations midt if (properties.displayCenterOfRotation) { var center = CalcNewPoint(new PointF3D()); canvas.DrawAt(Color.Blue, (int)center.X, (int)center.Y, properties.wFPointSize * 4f); } //Draw lines DrawLines(canvas, colorLines); //Draw with points on them DrawPoints(canvas, colorPoints); }