ID3DXSprite Problem

This topic is 4862 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

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

Share on other sites
I´m the anonymous abobe, sorry I forgot to log in :(

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

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

Share on other sites

This topic is 4862 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

• Forum Statistics

• Total Topics
628759
• Total Posts
2984538

• 12
• 25
• 12
• 10
• 17