Text archives Help
- From: arobison@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1907 - trunk/Model/Readers/glm
- Date: Tue, 4 Dec 2007 23:03:21 -0700 (MST)
Author: arobison
Date: Tue Dec 4 23:03:20 2007
New Revision: 1907
Modified:
trunk/Model/Readers/glm/glm.cc
trunk/Model/Readers/glm/glm.h
Log:
Adding glm/OBJ support for reading map_D values ("dissolve maps").
Modified: trunk/Model/Readers/glm/glm.cc
==============================================================================
--- trunk/Model/Readers/glm/glm.cc (original)
+++ trunk/Model/Readers/glm/glm.cc Tue Dec 4 23:03:20 2007
@@ -348,6 +348,7 @@
model->materials[i].ambient_map[0] = '\0';
model->materials[i].diffuse_map[0] = '\0';
model->materials[i].specular_map[0] = '\0';
+ model->materials[i].dissolve_map[0] = '\0';
model->materials[i].ambient_map_scaling[0] = 0;
model->materials[i].ambient_map_scaling[1] = 0;
@@ -355,6 +356,8 @@
model->materials[i].diffuse_map_scaling[1] = 0;
model->materials[i].specular_map_scaling[0] = 0;
model->materials[i].specular_map_scaling[1] = 0;
+ model->materials[i].dissolve_map_scaling[0] = 0;
+ model->materials[i].dissolve_map_scaling[1] = 0;
}
model->materials[0].name = strdup("NO_ASSIGNED_MATERIAL");
@@ -406,6 +409,9 @@
} else if (strcmp(buf,"map_Ks")==0) {
map_name = model->materials[nummaterials].specular_map;
scaling = model->materials[nummaterials].ambient_map_scaling;
+ } else if (strcmp(buf,"map_D")==0) {
+ map_name = model->materials[nummaterials].dissolve_map;
+ scaling = model->materials[nummaterials].dissolve_map_scaling;
} else {
// We don't know what kind of map it is, so ignore it
fprintf(stderr, "Unknown map: \"%s\" found at %s(%d)\n", buf,
Modified: trunk/Model/Readers/glm/glm.h
==============================================================================
--- trunk/Model/Readers/glm/glm.h (original)
+++ trunk/Model/Readers/glm/glm.h Tue Dec 4 23:03:20 2007
@@ -59,11 +59,13 @@
char ambient_map [MaxStringLength]; // map_Ka
char diffuse_map [MaxStringLength]; // map_Kd
char specular_map[MaxStringLength]; // map_Ks
+ char dissolve_map[MaxStringLength]; // map_D
// Scaling for texture maps (initialized to 0 for not set)
float ambient_map_scaling[2];
float diffuse_map_scaling[2];
float specular_map_scaling[2];
+ float dissolve_map_scaling[2];
} GLMmaterial;
- [Manta] r1907 - trunk/Model/Readers/glm, arobison, 12/05/2007
Archive powered by MHonArc 2.6.16.