Jump to content
  • Advertisement

Archived

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

kudi

3D Studio - matrix

This topic is 5717 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 read several documents about the file format of .3ds-file, but there is never a good description of the matrix you can find at the chunk 0x4160. I am using Direct3D. how do I have to load this matrix correct? I never got a good result. my legs, head, body etc. were all over the screen, but not at the right place. I tried:
    
//my matrix:

float m[4][4];  //the same like direct3d uses


m.SetIdentity();
for(lj=0;lj<4;lj++)
  for(li=0;li<3;li++)
    fread(&m[lj][li,sizeof(float),1,pFile);

//and then

lpD3DDevice->SetTransform(...._WORLD,m);
  
(I know the syntax is not correct here) but something is wrong.. do i have to use two matrices, a translation and rotation or something like that? [edited by - kudi on April 18, 2003 12:03:04 PM]

Share this post


Link to post
Share on other sites
Advertisement
Here is some particularly awful code that loads this matrix:

case 0x4160:
{ // Local transformation matrix
int i, j;
if(tail == NULL) break;
for (j=0;j<4;j++)
{
for (i=0;i<3;i++)
{ fread(&(tail->lmat[j]),sizeof(float),1,bin3ds);
}
}
tail->lmat[0][3]=0;
tail->lmat[1][3]=0;
tail->lmat[2][3]=0;
tail->lmat[3][3]=1;
}
break;

Share this post


Link to post
Share on other sites

  • 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!