3d Mesh background with sprites on top

Ok, so i'm a complete noob to Directx. But the basic idea is to create a background ( I am assuming at this point a mesh with texture mapping) that is zoomable and scrollable (no need to rotate, although that may be added in the future) with simple 2d objects on top of the background ( right now I was planning on using sprites) I am using directX 9 and programmingin c#.
Right now the problem is the sprites and the map are being drawn and I can zoom and scroll the background but the sprites are "behind" the map. I tried changing the Z order of the sprites to put them "in front" of the background, but that apparently wasn't enough. Can anyone help me out here



Answer this question

3d Mesh background with sprites on top

  • Nihal Chand

    The October SDK will most likely have a sample that shows you how to do sprite-based tile scrolling.  Just hang on a couple more weeks Smile

  • Ahmed-Mahdy

    Cool, Does this mean that there are going to be some more samples for Managed code, will these be in C# and VB.Net.

  • Luke Westendorf MSFT

    Thanks, Dominic!

    I've been wrestling with the same problem for quite a while on a game I'm writing (just to learn DirectX coding). I can't believe that the solution was so simple as changing the rendering order. Rendering the sprites last put them in front of the meshes, which is exactly what I needed to do. I've been trying to change to Z position, messing around with cull mode and alpha blending parameters, and anything else I could think of.

    Rendering the sprites AFTER the meshes never crossed my mind! Duh!

  • Gustavo.

    I had this problem before. I think you have to render the 3D meshes and then render the sprites by calling begin sprite after the 3D work has been done.
    Im not sure why this was and so if anyone knows differently please explain.
    But if you do BeginScene. Then display your 3D graphics then do Begin Sprite and then do your 2D stuff it should be fine.

    Dominic

  • 3d Mesh background with sprites on top