Example #1
0
        public virtual void Draw(Tessellator par1Tessellator, float par2)
        {
            Vec3D vec3d  = VertexPositions[1].Vector3D.Subtract(VertexPositions[0].Vector3D);
            Vec3D vec3d1 = VertexPositions[1].Vector3D.Subtract(VertexPositions[2].Vector3D);
            Vec3D vec3d2 = vec3d1.CrossProduct(vec3d).Normalize();

            par1Tessellator.StartDrawingQuads();

            if (InvertNormal)
            {
                par1Tessellator.SetNormal(-(float)vec3d2.XCoord, -(float)vec3d2.YCoord, -(float)vec3d2.ZCoord);
            }
            else
            {
                par1Tessellator.SetNormal((float)vec3d2.XCoord, (float)vec3d2.YCoord, (float)vec3d2.ZCoord);
            }

            for (int i = 0; i < 4; i++)
            {
                PositionTextureVertex positiontexturevertex = VertexPositions[i];
                par1Tessellator.AddVertexWithUV((float)positiontexturevertex.Vector3D.XCoord * par2, (float)positiontexturevertex.Vector3D.YCoord * par2, (float)positiontexturevertex.Vector3D.ZCoord * par2, positiontexturevertex.TexturePositionX, positiontexturevertex.TexturePositionY);
            }

            par1Tessellator.Draw();
        }