Directx vertex rendering: unable to get texture to display correctly for trapetzoids

StackOverflow https://stackoverflow.com/questions/4939119

  •  30-10-2019
  •  | 
  •  

سؤال

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:

Problem's illustration

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));

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top