www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: penprakash on March 04, 2013, 06:31:30 pm

Title: Obj model loading error
Post by: penprakash on March 04, 2013, 06:31:30 pm
Hi,

 I have downloaded obj file from this site http://people.sc.fsu.edu/~jburkardt/data/obj/obj.html and tried to use it in my application ( JPCT-AE) got following error

03-04 22:58:47.749: E/AndroidRuntime(22464): java.lang.RuntimeException: [ 1362418127753 ] - ERROR: java.lang.RuntimeException: [ 1362418127740 ] - ERROR: Unsupported Texture width: 929
03-04 22:58:47.749: E/AndroidRuntime(22464):    at com.threed.jpct.Logger.log(Logger.java:193)
03-04 22:58:47.749: E/AndroidRuntime(22464):    at com.threed.jpct.Texture.loadTexture(Texture.java:798)
03-04 22:58:47.749: E/AndroidRuntime(22464):    at com.threed.jpct.Texture.loadTexture(Texture.java:771)
03-04 22:58:47.749: E/AndroidRuntime(22464):    at com.threed.jpct.Texture.<init>(Texture.java:138)

Please tell me supported texture width.

Prakash V
Title: Re: Obj model loading error
Post by: EgonOlsen on March 04, 2013, 06:41:05 pm
Like the docs state, texture width and height has to be a power of 2. 929 isn't a power of 2.
Title: Re: Obj model loading error
Post by: penprakash on March 05, 2013, 03:57:59 pm
But docs says Texture size has to be a power of 2. Any texture using another width and/or height will automatically be scaled to a width of 256 pixels. jPCT will print out a warning in this case.
Title: Re: Obj model loading error
Post by: EgonOlsen on March 05, 2013, 07:26:43 pm
No, that's what the docs of the desktop version state....because that's what the desktop version does. The Android version raises an error and so say the docs.
Title: Re: Obj model loading error
Post by: penprakash on April 10, 2013, 05:49:57 pm
Hi,

 How do i find out texture height and width is power of 2? If it is not, is possible to convert texture width and height?

Thanks & Regards,
Prakash V
Title: Re: Obj model loading error
Post by: EgonOlsen on April 10, 2013, 08:54:35 pm
Power of 2...4,8,16,32,64,128,256,512,1024...it shouldn't be too hard to find out if width and height are any or those. If they aren't, take your prefered image editing tools and rescale them.