2D in 3D Texture Woe using C#

0 views
Skip to first unread message

Balaam

unread,
Dec 10, 2005, 1:51:51 AM12/10/05
to
I've come across a texture problem in my 2D tile game in 3D.

I know about the texel pixel issues when trying to create a 2D game
using 3D quads described here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directly_mapping_texels_to_pixels.asp

Basically I can render my tiles perfectly but when I move the camera,
(by transforming the view matrix) sometimes a border line of my tiles
textures will stretch to two pixels or vanish completely.

I've taken the code out and put it into a very simple program to
demonstrate my problem easily.

Heres the source code: http://ravensmyst.com/balaam/Problem.zip

Someone suggested I clamp the textures - I did this and it removed pink
lines I was getting but the lines expanding and disspearing remained.

Here's a screen shot of what it looks like at the start:

http://ravensmyst.com/balaam/happy.png

And after moving the camera down a bit:

http://ravensmyst.com/balaam/mope.png

My wild guess is that's it something to do with the random manner in
which I've set the camera up. Can some one set me straight, please!

Reply all
Reply to author
Forward
0 new messages