Hi guys,
I am working on an image processing application that takes a texture as input an generates a perspective transformed output based on a quadrilateral the size and shape of which the user decides. I also need to tile the perspective output to correctly fit a rectangle of a preset size.
eg:
http://i19.photobucket.com/albums/b193/Coincoin/perspective-correction.pngI could get the image transformed in perspective using some image processing libraries, but cannot get the tiling part done. Did a lot of research. I used a big tiled image as input but get memory errors as the size increases.
So I thought I will use TV3D to generate the tiled perspective image. To test it, I created a quad using add vertex (2 triangles) and set the UV values appropriately. But the output shows a mismatch along the line that separates the two triangles. What can be done regarding this?
Any ideas?
Here is the image showing the issue:
http://www.4shared.com/photo/CUhFc7aO/Quad.htmlRegards
Code:
Quad = Scene.CreateMeshBuilder("Quad");
Quad.SetPrimitiveType(CONST_TV_PRIMITIVETYPE.TV_TRIANGLELIST);
Quad.AddVertex(0, 100, 0, 0, 0, 1, 0, 0);
Quad.AddVertex(150, 120, 0, 0, 0, 1, 1, 0);
Quad.AddVertex(0, 0, 0, 0, 0, 1, 0, 1);
Quad.AddVertex(0, 0, 0, 0, 0, 1, 0, 1);
Quad.AddVertex(150, 120, 0, 0, 0, 1, 1, 0);
Quad.AddVertex(100, 0, 0, 0, 0, 1, 1, 1);
Quad.SetTexture(IDDiffuse);