Bonzai Engine Forum
Bonzai Engine & Tools => Bonzai Engine on Android => Topic started by: freeman on June 19, 2012, 06:28:19 AM
-
Hi!
I have animated model ogro.md2 in assets.
Code to load the model:
Model loaded, but it not animated and displays only first frame of animation.
Another error I've got onPause
E/Adreno200-ES20(27738): <process_gl_state_enables:456>: GL_INVALID_ENUM
And after onResume that the model is disappear.
My last question - how to set transparent background?
All code I've got from android standalone example.
Thank!
-
If you're using BeStandaloneTutorial tutorial, it is missing animation update which you should call before RendererPipeline.render:
Another error I've got onPause
E/Adreno200-ES20(27738): <process_gl_state_enables:456>: GL_INVALID_ENUM
And after onResume that the model is disappear.
I'll have to check that. This is certainly due to the fact opengl context lost is not supported by this tutorial and the tutorial is missing setPreserveEGLContextOnPause and possibly orientation configChanges in your manifest.
Keep in mind that BeStandaloneTutorial is a very basic tutorial due to the fact most of the engine framework is intentionally not used for those who prefer to integrate the engine within existing framework.
BeTutorial provides a more complete tutorial (opengl context maintained on pause, timing update, ...).
My last question - how to set transparent background?
I'll post this evening an exemple to set transparent background on android to see the View behind the GLSurfaceView.
-
Here's the piece of code you'll need to make the background transparent or transluscent:
and set the clear color to 0:
If you also wish to set the activity window transparent, add in the activity manifest:
and in the styles.xml:
-
Thank for reply!
I have another question. How to play animated fbx file?
I load model with this code
When model loaded, there is only first frame
onDrawFrameMethod:
-
You can select the animation to play using:
-
Thank you for reply, Jérôme
I've tried to do it like in example:
but following code returns "0"
Am I right that it means that there are no animations in fbx model? Or may be something else can cause getNumAnimations equality to 0?
Thanks in advance
-
This means that either your fbx has been exported with no animations or for some reason the reader was not able to parse animation.
If you export the fbx yourself, review the options you used in the fbx export animation panel (as far as I remember, there's an option to check to export properly animations). If you're sure the fbx contains animation, you can send me by email and I'll give a look to fix the reader.
-
Hi, Jérôme
Can you send me a couple of fbx files on which you tested the Bonzai? I can't understand if my files is bad or I've done errors in my code.
p.s. What is the best place for animation playing for asyncModel? I'm trying to find such place, but can't find a delegate which could be run when model loading complete.
Thanks for your help.
-
You can manipulate ModelInstance instead of AsyncModel:
There don't seem to be any error in your code for playing animation. It's either in the fbx export options or in our fbx parser.
You can use fbx models from FREE Medieval pack by DEXSOFT-GAMES (http://dexsoft-games.com/models/medieval_free.html).