Author Topic: Obj model loading error  (Read 2441 times)

Offline penprakash

  • byte
  • *
  • Posts: 26
    • View Profile
Obj model loading error
« 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Obj model loading error
« Reply #1 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.

Offline penprakash

  • byte
  • *
  • Posts: 26
    • View Profile
Re: Obj model loading error
« Reply #2 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Obj model loading error
« Reply #3 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.

Offline penprakash

  • byte
  • *
  • Posts: 26
    • View Profile
Re: Obj model loading error
« Reply #4 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
« Last Edit: April 11, 2013, 09:00:57 am by penprakash »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Obj model loading error
« Reply #5 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.