Revision 692,
1000 bytes
checked in by mattausch, 19 years ago
(diff) |
adding ogre 1.2 and dependencies
|
Line | |
---|
1 | function writeMaterial material outFile = |
---|
2 | ( |
---|
3 | local t, matname, mat; |
---|
4 | |
---|
5 | mat = material ; |
---|
6 | |
---|
7 | if (mat != undefined) then |
---|
8 | ( |
---|
9 | matname = material.name ; |
---|
10 | format "3ds/%\n" matname to:outFile ; |
---|
11 | format "{\n" ; |
---|
12 | format(" ambient % % %\n") (mat.ambient.r/255.0) (mat.ambient.g/255.0) (mat.ambient.b/255.0) to:outFile ; |
---|
13 | format(" diffuse % % %\n") (mat.diffuse.r/255.0) (mat.diffuse.g/255.0) (mat.diffuse.b/255.0) to:outFile ; |
---|
14 | format(" specular % % % %\n") (mat.specular.r/255.0) (mat.specular.g/255.0) (mat.specularLevel*100.0) to:outFile ; |
---|
15 | format(" emissive % % % %\n") (mat.selfIllumColor.r/255.0) (mat.selfIllumColor.g/255.0) (mat.selfIllumColor.b/255.0) (mat.selfIllumAmount) to:outFile ; |
---|
16 | |
---|
17 | -- if mesh has a material: reading the diffuse map: |
---|
18 | if ((mat.diffusemap != undefined) and (iskindof mat.diffusemap Bitmaptexture)) then |
---|
19 | ( |
---|
20 | t = filterstring mat.diffusemap.filename "\\" ; |
---|
21 | format "{\n texture % \n}" t[arrayLength t] to:outFile ; |
---|
22 | ) |
---|
23 | format "}\n" ; |
---|
24 | ) |
---|
25 | ) |
---|
Note: See
TracBrowser
for help on using the repository browser.