Discontinuity of Texture Mapping

Started by
5 comments, last by dzzunga 14 years, 11 months ago
Hi All, My application uses DirectX 9 to render trapezoid and fill it with texture, but the texture mapping result is undesired, there are some discontinuities between 2 triangles. This is some thing like only Affine mapping, not Perspective Correction, but this is pure 2D rendering and i have no depth(z) for trapezoid geometry. Please take a look at image : http://s186.photobucket.com/albums/x162/dzzunga/?action=view&current=trapezoid_mapping.jpg Does anybody have any idea how to set DirectX to work properly in this case ? I greatly appreciate your kindness.
Advertisement
I can't get the image to load, and hence can't see what the issue is that you are having. Do you have anywhere else that you could upload the image to?
Dear Jason,

Please click the link to see image


Quote:Original post by dzzunga
Dear Jason,

Please click the link to see image


What texture coord are you using for the vertex at the top left of your poly? You probably want to offset the X coord into the texture a bit.
Hi Kath,

Texture coord of the top left vertex of my poly is :
u = (float)(point1.x)/(Texture Width);
v = 0;

top right:
u = (float)(point2.x)/(Texture Width);
v = 0;

bottom left:
u = 0;
v = 1.0f;

bottom right:
u = 1.0f;
v = 1.0f;
Are you using shaders to sample the texture, or are you using fixed function rendering? If using shaders, you might want to post the shader code so we could take a look for anything strange. I've seen those types of artifacts when 3 component vectors get normalized as 4 component vectors and so on.
Hi Jason,

I don't use shaders, i use DrawPrimitive to render 2 triangles of trapezoid.

This topic is closed to new replies.

Advertisement