Projection and matrix reference notes monogame specific.

For completeness here is the code for creating a triangle you can test the above with.

were layerDepth is equivalent to zPolygonsOffsetIntoTheWorld in the above example.



    public static void IndexedTriangle(GraphicsDevice graphicsDevice, Rectangle r, float layerDepth, out VertexPositionTexture[] vertices, out int[] indices)
    {
        vertices = new VertexPositionTexture[4];
        vertices[0] = new VertexPositionTexture() { Position = new Vector3(r.Left, r.Top, layerDepth), TextureCoordinate = new Vector2(0f, 0f) };
        vertices[1] = new VertexPositionTexture() { Position = new Vector3(r.Left, r.Bottom, layerDepth), TextureCoordinate = new Vector2(0f, 1f) };
        vertices[2] = new VertexPositionTexture() { Position = new Vector3(r.Right, r.Bottom, layerDepth), TextureCoordinate = new Vector2(1f, 1f) };
        vertices[3] = new VertexPositionTexture() { Position = new Vector3(r.Right, r.Top, layerDepth), TextureCoordinate = new Vector2(1f, 0f) };

        indices = new int[6];
        if (graphicsDevice.RasterizerState == RasterizerState.CullClockwise)
        {
            indices[0] = 0; indices[1] = 1; indices[2] = 2;
            indices[3] = 2; indices[4] = 3; indices[5] = 0;
        }
        else
        {
            indices[0] = 0; indices[1] = 2; indices[2] = 1;
            indices[3] = 2; indices[4] = 0; indices[5] = 3;
        }
    }

Since i didn’t mention how the above may relate to vertices world positions take note of the if else in the above function from which a logical deduction can be made.