public override void DrawEnd(Graphics3D graphics) { // sanity check if (_height <= 1.0E-3) { return; } Face[] faces = Faces; if (Vector3D.DotProduct(faces[0].Normal, graphics.ViewDirection) <= 0.0) { for (int i = 0; i < 4; ++i) { graphics.AddFace(faces[i]); } } if (Vector3D.DotProduct(faces[4].Normal, graphics.ViewDirection) <= 0.0) { for (int i = 4; i < 8; ++i) { graphics.AddFace(faces[i]); } } if (Math.Abs(Vector3D.DotProduct(faces[0].Normal, graphics.ViewDirection)) < 1.0E-3) { graphics.AddFace(faces[3]); } if (Math.Abs(Vector3D.DotProduct(faces[4].Normal, graphics.ViewDirection)) < 1.0E-3) { graphics.AddFace(faces[7]); } }
public override void DrawBegin(Graphics3D graphics) { foreach (Face face in Faces) { graphics.AddFace(face); } }
public override void DrawEnd(Graphics3D graph) { foreach (FilmRectangle rectangle in _rectangles) { double cosA = System.Math.Abs(Vector3D.DotProduct(rectangle.Normal, graph.ViewDirection)); Color color = Color.FromArgb( 255 , (int)(rectangle.Color.R * cosA) , (int)(rectangle.Color.G * cosA) , (int)(rectangle.Color.B * cosA)); if (Vector3D.DotProduct(rectangle.Normal, graph.ViewDirection) < 0) { // transparency if (HasTransparency) { foreach (Face face in rectangle.Faces) { graph.AddFace(face); } } // hatching if (HasHatching) { Segment[] segments = rectangle.Segments; foreach (Segment s in segments) { s.Color = color; graph.AddSegment(s); } } } } }
public override void DrawEnd(Graphics3D graphics) { Face[] faces = Faces; for (int i = 0; i < 4; ++i) { graphics.AddFace(Faces[i]); } }
private void AddFace(Graphics3D graphics, Vector3D p0, Vector3D p1) { var pt0 = p0 + 0.5 * Width * Axis; var pt1 = p0 - 0.5 * Width * Axis; var pt2 = p1 - 0.5 * Width * Axis; var pt3 = p1 + 0.5 * Width * Axis; graphics.AddFace(new Face(0, new Vector3D[] { pt0, pt1, pt2, pt3 }, Color, Color.Black, "STRAPPER")); }
public override void DrawEnd(Graphics3D graphics) { Face[] faces = Faces; if (Vector3D.DotProduct(faces[0].Normal, graphics.ViewDirection) <= 0.0) { for (int i = 0; i < 4; ++i) { graphics.AddFace(faces[i]); } } if (Vector3D.DotProduct(faces[4].Normal, graphics.ViewDirection) <= 0.0) { for (int i = 4; i < 8; ++i) { graphics.AddFace(faces[i]); } } }
public void DrawInside(Graphics3D graphics, Transform3D transform) { Face[] faces = InsideFaces; for (int i = 0; i < 6; ++i) { faces[i].IsSolid = false; } foreach (Face face in faces) { graphics.AddFace(face.Transform(transform)); } }
public void DrawInside(Graphics3D graphics) { Face[] faces = Faces; for (int i = 0; i < 6; ++i) { faces[i].IsSolid = false; } foreach (Face face in faces) { graphics.AddFace(face); } }
public override void DrawEnd(Graphics3D graphics) { graphics.AddFace(Face); }
public override void Draw(Graphics3D graphics) { foreach (Face face in Faces) graphics.AddFace(face); }
public void DrawInside(Graphics3D graphics) { Face[] faces = Faces; for (int i = 0; i < 6; ++i) faces[i].IsSolid = false; foreach (Face face in faces) graphics.AddFace(face); }
public override void DrawEnd(Graphics3D graphics) { Face[] faces = Faces; if (Vector3D.DotProduct(faces[0].Normal, graphics.ViewDirection) <= 0.0) { for (int i = 0; i < 4; ++i) { graphics.AddFace(faces[i]); } } if (Vector3D.DotProduct(faces[4].Normal, graphics.ViewDirection) <= 0.0) { for (int i = 4; i < 8; ++i) graphics.AddFace(faces[i]); } }
public override void DrawEnd(Graphics3D graph) { foreach (FilmRectangle rectangle in _rectangles) { double cosA = System.Math.Abs(Vector3D.DotProduct(rectangle.Normal, graph.ViewDirection)); Color color = Color.FromArgb( 255 , (int)(rectangle.Color.R * cosA) , (int)(rectangle.Color.G * cosA) , (int)(rectangle.Color.B * cosA)); if (Vector3D.DotProduct(rectangle.Normal, graph.ViewDirection) < 0) { // transparency if (HasTransparency) { foreach (Face face in rectangle.Faces) graph.AddFace(face); } // hatching if (HasHatching) { Segment[] segments = rectangle.Segments; foreach (Segment s in segments) { s.Color = color; graph.AddSegment(s); } } } } }