OpenGL



             

31. Milkshape 3D - 6


 

m_pMeshes[i].m_materialIndex = materialIndex;

m_pMeshes[i].m_numTriangles = nTriangles;

m_pMeshes[i].m_pTriangleIndices = pTriangleIndices;

}

( Milkshape3D "groups"). , . . .

int nMaterials = *( word* )pPtr;

m_numMaterials = nMaterials;

m_pMaterials = new Material[nMaterials];

pPtr += sizeof( word );

for ( i = 0; i < nMaterials; i++ )

{

MS3DMaterial *pMaterial = ( MS3DMaterial* )pPtr;

memcpy( m_pMaterials[i].m_ambient, pMaterial->m_ambient, sizeof( float )*4 );

memcpy( m_pMaterials[i].m_diffuse, pMaterial->m_diffuse, sizeof( float )*4 );

memcpy( m_pMaterials[i].m_specular, pMaterial->m_specular,

sizeof( float )*4 );

memcpy( m_pMaterials[i].m_emissive, pMaterial->m_emissive,

sizeof( float )*4 );

m_pMaterials[i].m_shininess = pMaterial->m_shininess;

m_pMaterials[i].m_pTextureFilename = new char[strlen(

pMaterial->m_texture )+1];

strcpy( m_pMaterials[i].m_pTextureFilename, pMaterial->m_texture );

pPtr += sizeof( MS3DMaterial );

}

reloadTextures();

, . , , . , , . reloadTextures OpenGL. Model .