Subversion Repositories gelsvn

Rev

Rev 364 | Rev 510 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 364 Rev 421
Line 117... Line 117...
117
				sscanf(buf, "%s %s", buf, buf);
117
				sscanf(buf, "%s %s", buf, buf);
118
				nummaterials++;
118
				nummaterials++;
119
				mesh->materials[nummaterials].name = buf;
119
				mesh->materials[nummaterials].name = buf;
120
				break;
120
				break;
121
			case 'N':
121
			case 'N':
-
 
122
        switch(buf[1])
-
 
123
          {
-
 
124
          case 's':
122
				fscanf(file, "%f", &mesh->materials[nummaterials].shininess);
125
				    fscanf(file, "%f", &mesh->materials[nummaterials].shininess);
123
				/* wavefront shininess is from [0, 1000], so scale for OpenGL */
126
				    /* wavefront shininess is from [0, 1000], so scale for OpenGL */
124
				mesh->materials[nummaterials].shininess /= 1000.0;
127
				    mesh->materials[nummaterials].shininess /= 1000.0;
125
				mesh->materials[nummaterials].shininess *= 128.0;
128
				    mesh->materials[nummaterials].shininess *= 128.0;
-
 
129
            break;
-
 
130
          case 'i':
-
 
131
				    fscanf(file, "%f", &mesh->materials[nummaterials].ior_in);
-
 
132
            break;
-
 
133
					default:
-
 
134
						/* eat up rest of line */
-
 
135
						fgets(buf, sizeof(buf), file);
-
 
136
						break;
-
 
137
          }
126
				break;
138
				break;
127
			case 'K': 
139
			case 'K': 
128
				switch(buf[1]) 
140
				switch(buf[1]) 
129
					{
141
					{
130
					case 'd':
142
					case 'd':
Line 149... Line 161...
149
						/* eat up rest of line */
161
						/* eat up rest of line */
150
						fgets(buf, sizeof(buf), file);
162
						fgets(buf, sizeof(buf), file);
151
						break;
163
						break;
152
					}
164
					}
153
				break;
165
				break;
-
 
166
      case 'T':
-
 
167
				fscanf(file, "%f %f %f",
-
 
168
               &mesh->materials[nummaterials].transmission[0],
-
 
169
               &mesh->materials[nummaterials].transmission[1],
-
 
170
               &mesh->materials[nummaterials].transmission[2]);
-
 
171
        break;
-
 
172
      case 'i':
-
 
173
				fscanf(file, "%d", &mesh->materials[nummaterials].illum);
-
 
174
        break;
154
			case 'm': // Map ... all maps are treated equally.
175
			case 'm': // Map ... all maps are treated equally.
155
				{
176
				{
156
					fscanf(file,"%s",buf);
177
					fscanf(file,"%s",buf);
157
					mesh->materials[nummaterials].tex_path = pathname;
178
					mesh->materials[nummaterials].tex_path = pathname;
158
					mesh->materials[nummaterials].tex_name = string(buf);
179
					mesh->materials[nummaterials].tex_name = string(buf);