private void drawTriangle(Triangle3D tria) {
	if (tria == null) return;
	Point3DOdn a = convPToScreen(tria.getV1());
	Point3DOdn b = convPToScreen(tria.getV2());
	Point3DOdn c = convPToScreen(tria.getV3());
	int sy, x1, x2;
	boolean flag = true;
	// здесь сортируем вершины (A,B,C)
	while (flag) {
	    flag = false;
	    if (b.getY() < a.getY()) {
		Point3DOdn d = b;
		b = a;
		a = d;
		flag = true;
	    }
	    if (c.getY() < b.getY()) {
		Point3DOdn d = c;
		c = b;
		b = d;
		flag = true;
	    }
	}
	//закраска треугольника
	for (sy = (int) (a.getY()); sy < c.getY(); sy++) {
	    x1 = (int) (a.getX()) + (sy - (int) (a.getY())) * ((int) (c.getX())
		    - (int) (a.getX())) / ((int) (c.getY()) - (int) (a.getY()));
	    if (sy < b.getY()) {
		x2 = (int) (a.getX()) + (sy - (int) (a.getY())) * ((int) (b.getX())
			- (int) (a.getX())) / ((int) (b.getY()) - (int) (a.getY()));
	    } else {
		if (c.getY() == b.getY()) {
		    x2 = (int) (b.getX());
		} else {
		    x2 = (int) (b.getX()) + (sy - (int) (b.getY())) * ((int) (c.getX())
			    - (int) (b.getX())) / ((int) (c.getY()) - (int) (b.getY()));
		}
	    }
	    if (x1 > x2) {
		int tmp = x1;
		x1 = x2;
		x2 = tmp;
	    }
	    Point3DOdn p1 = new Point3DOdn(x1, sy, 0);
	    Point3DOdn p2 = new Point3DOdn(x2, sy, 0);
	    drawBufferedLine(tria, p1, p2);
	}
    }