Author Topic: LoadingModel  (Read 9506 times)

freebyte

  • Jr. Member
  • **
  • Posts: 3
LoadingModel
« on: October 03, 2013, 06:17:07 PM »
Hi,

Hi looked at the tutorials and I am now trying to load an obj file in a GLSurfaceView for Android.
The thnig is that I always get an error when loading the model.



Here is the renderer I made. The constructor take a path to the obj file. (The file exists, I checked)


I tried setting the stream like this


Because when I initialized it like this:


I had this error:


freebyte

  • Jr. Member
  • **
  • Posts: 3
Re: LoadingModel
« Reply #1 on: October 03, 2013, 06:26:12 PM »
Oops.. just realized I should have posted that in the Android section..  ::)
Sorry about that.

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: LoadingModel
« Reply #2 on: October 04, 2013, 12:05:23 AM »
Using setReadTextureAsync requires to assign a worker to the engine using BonzaiEngine.get().setWorker. This specifies in how many threads the async works are dispatched.

There's obviously a bug when using a Stream created from an input stream. I'll fix that for the next release.

freebyte

  • Jr. Member
  • **
  • Posts: 3
Re: LoadingModel
« Reply #3 on: October 04, 2013, 02:54:17 PM »
Thank you for your reply.

So is there a workaround in order to make it work? Or should I wait for the next release?

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: LoadingModel
« Reply #4 on: October 04, 2013, 03:11:14 PM »
The workaround is using Stream constructor using String and call setWorker (see tutorials) before loading.

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: LoadingModel
« Reply #5 on: October 12, 2013, 11:01:02 AM »
To proper fix would be to use:
Instead of:

Calling setWorker would also be necessary if you still request asynchronous texture loading.