I'm trying to create 3d effect using vertex and index buffers in 2d (z-coord is 0) using DirectX7.
It's easier to explain with a picture:
The problem is that the lines are broken. They should be straight. To render this image it gets break up in triangles and rendered using DrawIndexedPrimitiveVB. Obviously each of the triangle is skewed a little differently and I don't see why.
Am I missing something trivial here?
I'm not sure if this will help, but the source and destination quads are as follow:
SPoint4:= pBounds4(1, 1, W - 2, H - 2);
DPoint4:= Point4(ProjTo2dX(i, FlyDist + DeepDist, W), ProjTo2dY(0, FlyDist + DeepDist, H), ProjTo2dX(W - i, FlyDist, W), ProjTo2dY(0, FlyDist, H), ProjTo2dX(W - i, FlyDist, W), ProjTo2dY(H, FlyDist, H), ProjTo2dX(i, FlyDist + DeepDist, W), ProjTo2dY(H, FlyDist + DeepDist, H));
I found a solution or at least a workaround. Instead of breaking the image up in 2 triangles, I break it up in many (several horizontal strips, each consisting of 2 triangles). In this case the image looks ok.
in this case the image is split in 10 strips (20 triangles).
I'll be happy for any comments or other solutions. Thank you.