public static void Arrow(IPaintTo3D paintTo3D, GeoPoint base1, GeoPoint base2, GeoPoint apex) { GeoVector nor1 = (apex - base1) ^ (apex - base2); nor1.Norm(); double l = base1 | base2; GeoPoint c = new GeoPoint(base1, base2); GeoPoint base3 = c + l / 2.0 * nor1; GeoPoint base4 = c - l / 2.0 * nor1; GeoVector nor2 = (apex - base3) ^ (apex - base4); paintTo3D.Triangle(new GeoPoint[] { apex, base1, base2 }, new GeoVector[] { nor1, nor1, nor1 }, new int[] { 0, 1, 2 }); paintTo3D.Triangle(new GeoPoint[] { apex, base3, base4 }, new GeoVector[] { nor2, nor2, nor2 }, new int[] { 0, 1, 2 }); }
void IFeedBack.PaintTo3D(IPaintTo3D paintTo3D) { paintTo3D.UseZBuffer(true); paintTo3D.Blending(true); paintTo3D.SetColor(color); GeoPoint[] pnts = new GeoPoint[4]; pnts[0] = pln.ToGlobal(new GeoPoint2D(-width / 2, -height / 2)); pnts[1] = pln.ToGlobal(new GeoPoint2D(width / 2, -height / 2)); pnts[2] = pln.ToGlobal(new GeoPoint2D(width / 2, height / 2)); pnts[3] = pln.ToGlobal(new GeoPoint2D(-width / 2, height / 2)); GeoVector[] norm = new GeoVector[4]; norm[0] = pln.Normal; norm[1] = pln.Normal; norm[2] = pln.Normal; norm[3] = pln.Normal; int[] ind = new int[6]; ind[0] = 0; ind[1] = 1; ind[2] = 2; ind[3] = 0; ind[4] = 2; ind[5] = 3; paintTo3D.Triangle(pnts, norm, ind); paintTo3D.Blending(false); paintTo3D.UseZBuffer(true); }