Bonzai Engine Forum

Bonzai Engine & Tools => Bonzai Engine => Topic started by: freebyte on October 03, 2013, 06:17:07 PM

Title: LoadingModel
Post by: freebyte 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:

Title: Re: LoadingModel
Post by: freebyte on October 03, 2013, 06:26:12 PM
Oops.. just realized I should have posted that in the Android section..  ::)
Sorry about that.
Title: Re: LoadingModel
Post by: jerome_j 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.
Title: Re: LoadingModel
Post by: freebyte 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?
Title: Re: LoadingModel
Post by: jerome_j on October 04, 2013, 03:11:14 PM
The workaround is using Stream constructor using String and call setWorker (see tutorials) before loading.
Title: Re: LoadingModel
Post by: jerome_j 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.