Sorry.

I've to explain better:

I'm making a program with DirectX 8.1 and 3DS files.
In DirectX 8.1 a material is defined as:

typedef struct _D3DMATERIAL8 { 
   D3DCOLORVALUE Diffuse; 
   D3DCOLORVALUE Ambient; 
      D3DCOLORVALUE Specular; 
      D3DCOLORVALUE Emissive; 
      float Power; 
} D3DMATERIAL8; 

Diffuse, Ambient, Specular, and Emissive 
Values specifying the diffuse color, ambient color, specular color, and 
emissive color of the material, respectively. These values are D3DCOLORVALUE 
structures. 
Power 
Floating-point value specifying the sharpness of specular highlights. To 
turn off specular highlights for a material, set this member to 0.0; setting 
the 
specular color components to 0 is not enough. 


Diffuse, Ambient and Specular can be obtained from Lib3dsMaterial, but Emissive 
and Power... where are?

Thx!


----- Mensaje original ----

Date: Tue, 9 Sep 2008 15:28:26 +0200
From: "thomas pleyber" <[EMAIL PROTECTED]>
Subject: Re: [Lib3ds-devel] lib3ds & DirectX
To: "Discussion about lib3ds" <[email protected]>
Message-ID:
    <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

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