3D Studio - matrix

Started by
1 comment, last by kudi 21 years ago
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]
The problem of Object Oriented Programming:Everybody tells you how to use his classes, but nobody how not to do it !
Advertisement
please help !
The problem of Object Oriented Programming:Everybody tells you how to use his classes, but nobody how not to do it !
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;
GameDev Reader TODO List:1. Name my company.2. Buy domain name.3. Create web site.4. Name myself as CEO5. Create Game Engine.6. Design game.

This topic is closed to new replies.

Advertisement