njsubedi / min3d

Automatically exported from code.google.com/p/min3d

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Diffiuse Specular etc not loaded from obj file

GoogleCodeExporter opened this issue · comments

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

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