# ID3DXSprite and Zoom

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

## Recommended Posts

Hi, I just toyed around with the ID3DXSprite a bit more and I used DrawTransform to move it. But somehow it doesn't react to translations on the z-axis. I can't zoom it with DrawTransform. Is this even possible? Thanks in advance.

##### Share on other sites
I'm not sure but maybe this is what you mean:
Quote:
 From the DirectX documentationHRESULT Begin( DWORD Flags);D3DXSPRITE_OBJECTSPACE The world, view, and projection transforms are not modified. The transforms currently set to the device are used to transform the sprites when the batched sprites are drawn (when ID3DXSprite::Flush or ID3DXSprite::End is called). If this flag is not specified, then world, view, and projection transforms are modified so that sprites are drawn in screen-space coordinates.

##### Share on other sites
Quote:
 Original post by MannyCalaveraHi, I just toyed around with the ID3DXSprite a bit more and I used DrawTransform to move it. But somehow it doesn't react to translations on the z-axis. I can't zoom it with DrawTransform. Is this even possible?Thanks in advance.

You can't "Zoom" stuff in a orthographic projection by moving it in the Z axis.
To "Zoom" a sprite you would apply a scale transformation to it before rendering. E.g.:

pSprite->Begin();D3DXMATRIX trans,scale;D3DXMatrixScaling(&scale,2.0f,2.0f,1.0f);D3DXMatrixTranslation&trans,50.0f,132.0f,0.0f);scale *= trans;pSprite->SetTransform(&scale);pSprite->Draw(pTexture,NULL,NULL,NULL,0xFFFFFFFF);pSprite->End();

##### Share on other sites
Thanks.

What makes me wonder is that I don't use an ortohographic projection, I use a perspective and show my sprites.

http://www.gamasutra.com/features/20010629/geczy_pfv.htm

said, that I can transform the sprites when I use matrices:

Quote:

That's why I tried it. Is this wrong in itself?

1. 1
2. 2
3. 3
4. 4
Rutin
19
5. 5

• 14
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
632927
• Total Posts
3009253
• ### Who's Online (See full list)

There are no registered users currently online

×