Togethel2 / min3d

Automatically exported from code.google.com/p/min3d
0 stars 0 forks source link

Diffiuse Specular etc not loaded from obj file #82

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If I load a obj file without texture(it use diffiuse specular color), 
and I set  .colorMaterialEnabled(true).  but the object color isn't correct.

What can I do for this problem?

Beside I found that if the obj file is bigger enough, the objFace will throw 
numberFormatException.

so I modify code like this and fix it.

//number range is to small.
                v[index] = (int) (Integer.parseInt(subParts.nextToken()) - 1);
                if (hasuv)
                    uv[index] = (int) (Integer.parseInt(subParts.nextToken()) - 1);
                if (hasn)
                    n[index] = (int) (Integer.parseInt(subParts.nextToken()) - 1);
//              v[index] = (short) (Short.parseShort(subParts.nextToken()) - 1);
//              if (hasuv)
//                  uv[index] = (short) (Short.parseShort(subParts.nextToken()) - 1);
//              if (hasn)
//                  n[index] = (short) (Short.parseShort(subParts.nextToken()) - 1);

Original issue reported on code.google.com by CH.Long...@gmail.com on 1 Aug 2012 at 7:10

GoogleCodeExporter commented 9 years ago
This issue is also reported at issue 22. But I didn't get the resolution. 
thanks.

Original comment by CH.Long...@gmail.com on 1 Aug 2012 at 7:12