Archived

This topic is now archived and is closed to further replies.

loading textures with animations newbie

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

How can I load a animation in DirextX 8? Do I have to load all the textures from their own file. Or can i just load 1 file with all the textures included in that file. Plz give a link from a tutorial or some exemple code sorry for my bad English gobelair

Share this post


Link to post
Share on other sites
You do it how you''d like to do it.

If youre loading bitmap.. or similar then you need to load each one one by one.

-------
"Programming is like sex make one mistake, and you have to support it forever."
Homepage: www.ussshrike.com/pcwebvia/

Share this post


Link to post
Share on other sites
You load one texture with all the frames of animation in it. Then set up a texture-rectangle matrix with a function like this

D3DXMATRIX DXGMatrixTextureRect(float Width,float Height,D3DRECT Rect);
{
D3DXMATRIX mOut;
D3DXMatrixIdentity(mOut);
mOut[0,0] = (1/Width)*Rect.x2;
mOut[1,1] = (1/Height)*Rect.y2;
mOut[3,0] = (1/Width)*Rect.x1;
mOut[3,1] = (1/Height)*Rect.y1;
return mOut;
};

Or something like that. It''s an excerpt from the D3D wrapper I''ll be releasing soon in DLL form.

void Signature()
{
Only for Delphi.
};

Share this post


Link to post
Share on other sites