Jump to content
  • Advertisement
Sign in to follow this  
tom_mai78101

D3DX10_SPRITE: Should I leave D3DXMATRIX blank?

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

D3DX10_SPRITE contains a member called matWorld, which uses the struct D3DXMATRIX. Is it okay if I don't assign anything to it, after using ZeroMemory() on the D3DX10_SPRITE variable g_Sprite?

Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Well try to not asign anything and see if it works...

Or simply create a D3DXMATRIX, call D3DXMatrixIdentity() and assign it to the sprite...

Share this post


Link to post
Share on other sites

Well try to not asign anything and see if it works...

Or simply create a D3DXMATRIX, call D3DXMatrixIdentity() and assign it to the sprite...



Thanks.

Share this post


Link to post
Share on other sites
If you know what it does, then you will be able to answer that question yourself.
matWorld D3DXMATRIX The sprite's model-world transformation. This defines the position and orientation of the sprite in world space.

So, this is how you position, scale and rotate your image you want to display on the screen. If you do not set it, there will be junk data inside. Zeroing out the struct is not a valid matrix. Use the identity matrix instead.

Share this post


Link to post
Share on other sites

If you know what it does, then you will be able to answer that question yourself.
matWorld D3DXMATRIX The sprite's model-world transformation. This defines the position and orientation of the sprite in world space.

So, this is how you position, scale and rotate your image you want to display on the screen. If you do not set it, there will be junk data inside. Zeroing out the struct is not a valid matrix. Use the identity matrix instead.


Thanks again. I didn't expect that sprites also use matrices for drawing. That made me have to consult the MSDN Library two days ago just to understand it more.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!