Jump to content
  • Advertisement
Sign in to follow this  
Fruit

ID3DXSprite Problem

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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 this post


Link to post
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 this post


Link to post
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!