Hi Steve

You mean retrieving this information from a Lib3ds structure ?

if yes, here it is : the material information is handled by the faces. So
for the face n°*idxface* you have the corresponding material as follow :

*Lib3dsMesh *p3dsMesh ;

// ... init stuff

**std::string materialName = p3dsMesh->faceL[idxface].material ;* // which
gives you the name of the material for the face indexed *idxFace*


and then :

*Lib3dsMesh *p3dsMaterial ;*

*p3dsMaterial  = **lib3ds_file_material_by_name( p3dsFile,
**materialName**.c_str()
) ;* // with p3dsFile of type Lib3sdFile

*float r = p3dsMaterial->diffuse[0] ;
float g = p3dsMaterial->diffuse[1] ;
float b = p3dsMaterial->diffuse[2] ;*

But obviously before that you have to read the file and so on.


Hope it's what you want !


Regards,


Thomas
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
lib3ds-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lib3ds-devel

Reply via email to