# ID3DXSprite Problem

This topic is 5223 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm using 9.0b version of ID3DXSprite to draw a simple 800x600 background texture (no transform or translation supplied to ID3DXSprite). I then set up all my 3D stuff and render it. But it all renders BEHIND the background (ie you can't see it unless I don't draw the background -- then the 3D stuff looks just fine). So what am I doing wrong? I suspect I'm making some stupid mistake, but I'm just starting to use this stuff. Thanks for any suggestions.....

##### Share on other sites
Try setting the z sprite´s coordinate to 1 before calling the drwa function.

Something like this:

hr = m_ISprite->Draw(m_ITexture, &temp, NULL, D3DXVECTOR3(sprite_pos.x, sprite_pos.y, 1), D3DCOLOR_XRGB(255,255,255) );

##### Share on other sites
Zheo --

Thanks for suggesting that I try this (again). I had tried adding a translation on the Z axis without success previously. But when reviewing my code after your suggestion, I found that I had a default value for my Z translation of 0.0 and, along the chain of calls, was not passing my Z translation value so was ending up with 0.0 instead of 1.0 (or 100.0, or....). So, problem solved! And I appreciate your help! Thanks!!

By the way, the code I'm writing is all in Delphi....

-- Bill

##### Share on other sites
you could also disable ztesting and render the scene back to front (which would be much more efficient if you didnt have too many transparent meshes).

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633701
• Total Posts
3013445
×