Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1785 - trunk/Model/Groups
- Date: Thu, 18 Oct 2007 07:57:19 -0600 (MDT)
Author: bigler
Date: Thu Oct 18 07:57:19 2007
New Revision: 1785
Modified:
trunk/Model/Groups/ObjGroup.cc
Log:
Model/Groups/ObjGroup.cc
Start of fix for texture coordinates. Meshes assume that if any
texture coordinates exist they exit for all triangles. This
convention wasn't being followed.
Modified: trunk/Model/Groups/ObjGroup.cc
==============================================================================
--- trunk/Model/Groups/ObjGroup.cc (original)
+++ trunk/Model/Groups/ObjGroup.cc Thu Oct 18 07:57:19 2007
@@ -217,6 +217,8 @@
// Read in the groups.
GLMgroup *group = model->groups;
+ // If any triangle has texture coordinates, they all have to have them.
+ bool has_tex_coords = model->numtexcoords > 0;
while (group != 0) {
// Determine the material for this group.
@@ -254,6 +256,10 @@
index = model->triangles[ group->triangles[i] ].tindices[v];
if (index > 0) {
texture_indices.push_back(index-1);
+ } else if (has_tex_coords) {
+ // Again, we assume that if one triangle has a texture coordinate,
that
+ // all triangles do.
+ texture_indices.push_back(Mesh::kNoTextureIndex);
}
}
- [Manta] r1785 - trunk/Model/Groups, bigler, 10/18/2007
Archive powered by MHonArc 2.6.16.