Jump to content
  • Advertisement
Sign in to follow this  
doronf

Problem with sprite scale

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

Hi I have a problem with direct X sprite interface. What I want to do is render something to a render target once and then display it on a small part of the screen for a few frames over the main scene (sort of an overlay). My target is 256x256 and the area I want it to cover is smaller (not power of two). If I render the sprite as is, the result looks good but its too large, so I use SetTransform to scale down the sprite. Scale matrix looks like this: Sx, 0, 0, 0 0, Sy, 0, 0 0, 0, 0, 0 0, 0, 0, 1 The result is that there is something rendered in the correct spot and size, but it is just a mixture of colors that has nothing to do with the render target. No for the bizarre part, if I only scale on the X axis, the result looks good only its too long vertically... Card is nVidia 5700 (yes, yes, I will buy a new one soon) and no transparency is used. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
There's no need to create a scale matrix yourself...you can just use the D3DXMatrixTransformation2D() function to create one transform matrix for translation, rotation, and scaling.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!