Animation problem

Started by Zemalax, October 16, 2011, 11:10:51 PM

Previous topic - Next topic

AGP

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().

EgonOlsen

#16
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... ???

AGP

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.

EgonOlsen

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.

AGP

I will email one to you. Thanks a lot.

AGP

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.

EgonOlsen

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...

AGP

Cool. Thanks a lot, pal.