예제 #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]);
            }
        }
예제 #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]);
         }
     }
 }
예제 #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]); 
     }
 }