public void Paint(Graphics g, Rectangle fullMap) { var paintArgs = new MapPaintEventArgs(g, fullMap); Display.Paint(g, fullMap); Manipulators.Paint(paintArgs); }
public CockpitFuselage(Nose nose, float length, float baseScale, float bend) { Fuselage = Extrusion.Extrude <V, P> (false, false, nose.XSection, nose.XSection.Transform(Mat.Translation <Mat4> (0f, 0, -length) * Mat.Scaling <Mat4> (1f, baseScale, baseScale))); Fuselage = Composite.Create(Stacking.StackBackward(nose.Cone, Fuselage)); XSection = Path <P, Vec3> .FromVecs( from v in Fuselage.Vertices.Furthest (Dir3D.Back) where v.position.Y >= -0.2f select v.position).Close(); var pivotPoint = XSection.Vertices.Furthest(Dir3D.Up).First().position; Fuselage = Fuselage.ManipulateVertices( Manipulators.Transform <V> (Mat.RotationX <Mat4> (bend.Radians()).RelativeTo(pivotPoint)) .Where(v => v.position.Z > pivotPoint.Z), true) .Color(_color); XSectionStart = XSection.Vertices.Furthest(Dir3D.Down + Dir3D.Left).Single(); XSection = XSection.RenumberNodes(XSection.Vertices.IndexOf(XSectionStart)).Open(); }
public Nose(float middleHeight, float baseHeight, int numPoints, float bottomFlatness) { var spline = BSpline <Vec3> .FromControlPoints(2, new Vec3 (-1f, 0f, 0f), new Vec3 (0f, middleHeight, 0f), new Vec3 (1f, baseHeight, 0f)); Profile = Path <P, Vec3> .FromBSpline(spline, 8); Cone = Lathe <V> .Turn(Profile, turnAxis : Axis.X, offset : new Vec3(0f), stepAngle : MathHelper.TwoPi / numPoints) .ManipulateVertices( Manipulators.Scale <V> (1f, 1f - bottomFlatness, 1f).Where(v => v.position.Y < 0f), true) .RotateY(90f.Radians()) .Color(_color); XSection = Path <P, Vec3> .FromVecs( from v in Cone.Vertices.Furthest (Dir3D.Back) select v.position); }