Exemple #1
0
        public override void DrawBegin(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.AddFaceBackground(faces[i]);
                }
            }
            if (Vector3D.DotProduct(faces[4].Normal, graphics.ViewDirection) >= 0.0)
            {
                for (int i = 4; i < 8; ++i)
                {
                    graphics.AddFaceBackground(faces[i]);
                }
            }

            if (Math.Abs(Vector3D.DotProduct(faces[0].Normal, graphics.ViewDirection)) < 1.0E-3)
            {
                graphics.AddFaceBackground(faces[3]);
            }

            if (Math.Abs(Vector3D.DotProduct(faces[4].Normal, graphics.ViewDirection)) < 1.0E-3)
            {
                graphics.AddFaceBackground(faces[7]);
            }
        }
Exemple #2
0
 public override void DrawBegin(Graphics3D graphics)
 {
     Face[] faces = Faces;
     if (Vector3D.DotProduct(faces[0].Normal, graphics.ViewDirection) >= 0.0)
     {
         for (int i = 0; i < 4; ++i)
         {
             graphics.AddFaceBackground(faces[i]);
         }
     }
     if (Vector3D.DotProduct(faces[4].Normal, graphics.ViewDirection) >= 0.0)
     {
         for (int i = 4; i < 8; ++i)
         {
             graphics.AddFaceBackground(faces[i]);
         }
     }
 }
Exemple #3
0
 public override void DrawBegin(Graphics3D graphics)
 {
     Face[] faces = Faces;
     if (Vector3D.DotProduct(faces[0].Normal, graphics.ViewDirection) >= 0.0)
     {
         for (int i = 0; i < 4; ++i)
             graphics.AddFaceBackground(faces[i]);
     }
     if (Vector3D.DotProduct(faces[4].Normal, graphics.ViewDirection) >= 0.0)
     {
         for (int i = 4; i < 8; ++i)
             graphics.AddFaceBackground(faces[i]); 
     }
 }