Author Topic: Some questions  (Read 6143 times)

freeman

  • Jr. Member
  • **
  • Posts: 4
Some questions
« 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!

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: Some questions
« Reply #1 on: June 19, 2012, 11:04:32 AM »
If you're using BeStandaloneTutorial tutorial, it is missing animation update which you should call before RendererPipeline.render:

Quote
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, ...).

Quote
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.
« Last Edit: June 19, 2012, 07:55:13 PM by jerome_j »

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: Some questions
« Reply #2 on: June 19, 2012, 08:59:51 PM »
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:
« Last Edit: June 19, 2012, 09:05:30 PM by jerome_j »

freeman

  • Jr. Member
  • **
  • Posts: 4
Re: Some questions
« Reply #3 on: June 22, 2012, 08:50:28 AM »
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:

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: Some questions
« Reply #4 on: June 22, 2012, 11:43:59 AM »
You can select the animation to play using:

freeman

  • Jr. Member
  • **
  • Posts: 4
Re: Some questions
« Reply #5 on: June 22, 2012, 12:05:47 PM »
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
« Last Edit: June 22, 2012, 12:07:06 PM by freeman »

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: Some questions
« Reply #6 on: June 22, 2012, 12:14:31 PM »
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.

freeman

  • Jr. Member
  • **
  • Posts: 4
Re: Some questions
« Reply #7 on: June 22, 2012, 12:44:58 PM »
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.

jerome_j

  • Administrator
  • *****
  • Posts: 116
    • Bonzai Engine
Re: Some questions
« Reply #8 on: June 22, 2012, 01:58:34 PM »
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.
« Last Edit: June 22, 2012, 02:04:04 PM by jerome_j »