Beispiel #1
0
 public override void Draw(Graphics3D graphics)
 {
     foreach (Face face in Faces)
     {
         graphics.AddFace(face);
     }
 }
Beispiel #2
0
 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);
                 }
             }
         }
     }
 }
Beispiel #3
0
 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]);
         }
     }
 }
Beispiel #4
0
 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)
 {
     foreach (Face face in Faces)
             graphics.AddFace(face);
 }
Beispiel #6
0
 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]);
     }
 }
Beispiel #7
0
 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);
 }
Beispiel #8
0
 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);
                 }
             }
         }
     }
 }