Author Topic: Animation problem  (Read 7203 times)

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Animation problem
« Reply #15 on: April 07, 2012, 09:34:00 am »
Very odd result: now when the animation is supposed to change, the model blinks (as in ever-so-briefly disappears from the screen) but doesn't move. Note: with compile(true, true) called before calcBoundingBox() the model was dark (unlit) and seemed stuck on one of the keyframes. I've removed the explicit calls to compile().

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Animation problem
« Reply #16 on: April 07, 2012, 01:41:26 pm »
Maybe your animation is screwed up somehow? Do the meshes you are using actually match? How does the log output looks now? And what do you mean by 'you didn't expected the crash'? It's not a crash. It's an exception that happens on purpose and it also tells you what's wrong... ???
« Last Edit: April 07, 2012, 02:04:07 pm by EgonOlsen »

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Animation problem
« Reply #17 on: April 07, 2012, 06:21:36 pm »
It's a crash. The app crashes (or it did before we added calcBoundingBox()). And no, the animation is right, as again it's both the same code and the same models as the ones for the desktop version.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Animation problem
« Reply #18 on: April 07, 2012, 08:38:09 pm »
I guess it's pointless to argue about the semantic difference between a crash and an exception...and it doesn't solve the problem, so...i think i need a test case. Animations should work fine on Android and i've never seen a problem with them. I think it's something in the way you create the Animation, but i can't tell without a test case.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Animation problem
« Reply #19 on: April 07, 2012, 08:43:15 pm »
I will email one to you. Thanks a lot.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Animation problem
« Reply #20 on: April 08, 2012, 12:24:51 am »
I just sent it. I just noticed I forgot to include the hair model. Sorry about that. Just remove the reference to it. :- ) It doesn't really matter since it's not part of the animations.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Animation problem
« Reply #21 on: April 09, 2012, 04:50:04 pm »
There were/are a few problems...

  • Vertex count of the head and the head smiling don't match. This might not result in an obvious problem, but it's not correct either. It should be fixed if possible.
  • You are animating the head in worker thread, which is a bad idea. jPCT-AE (just like jPCT) isn't thread safe. Ignoring this is asking for trouble. In your test case, i simply fixed it by synchronizing rendering and animations to lal3d, but that's just a hack and nothing you really want to do.
  • The meshes used for the animations had no normales calculated. You should add a call to Object3D.calcNormals() just like you did for Object3D.calcBoundingBox().
  • If you do the former, there was a bug in jPCT-AE, which resulted in the center/rotation pivot not being calculated for lal3d. This has been fixed here: http://jpct.de/download/beta/jpct_ae.jar

I'll send my fixed version of the test case back to you...

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Animation problem
« Reply #22 on: April 09, 2012, 05:41:10 pm »
Cool. Thanks a lot, pal.