Author Topic: Loading Bones on Android  (Read 69954 times)

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #45 on: September 06, 2011, 12:24:35 am »
Oh, you may be counting the morphs' vertices in addition to the original pose's.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Loading Bones on Android
« Reply #46 on: September 06, 2011, 12:32:18 am »
the number comes from IVertexController.getSourceMesh(). it's still strange that 9300 polygons have 27000+ vertices. lots of them should be shared but apparently not in your case.

i don't know what Unity exactly does. maybe it uses hardware skinning?

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #47 on: September 06, 2011, 12:44:49 am »
Look at the screenshot: it's 4800 vertices.

Like I said, IVertexController is probably adding all the morphs together.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Loading Bones on Android
« Reply #48 on: September 06, 2011, 12:46:25 am »
jPCT reports me 27000+ vertices. Egon what do you think?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Loading Bones on Android
« Reply #49 on: September 06, 2011, 07:30:07 am »
If that's the size of the vertex array in the controller, it's the size that this thing has in memory. No idea what the loader loads though. You can verify this by using Mesh.getUniqueVertexCount(). It should more or less report the same number.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #50 on: September 06, 2011, 08:04:57 am »
Alright, but I think it's fairly safe to trust 3ds Max's count, don't you? It could be a wrong count by jpct (like, say, counting the sum of all of the morphs), or it could be something weird either by the exporter or by the importer (or, come to think of it, by the second importer and exporter to .bones format).

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Loading Bones on Android
« Reply #51 on: September 06, 2011, 08:14:00 am »
AGP whay don't you look at mesh.xml file?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Loading Bones on Android
« Reply #52 on: September 06, 2011, 08:24:24 am »
I've no idea what a morph is in this context...jPCT displays the number that someone (in this case the loader of that model) has given to it for a mesh. It's a simple array containing the vertex data. If it reports a size of X, that's the size it has...the question is: Why?

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #53 on: September 06, 2011, 08:52:48 am »
An example of a morph would be a copy of the same model with closed eyes. This particular model has several morphs. jpct's normal behavior should probably be to create a new frame for vertex animation (and not add all the different meshes into a single one), but then again I'm not sure how the animation blending is handled.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Loading Bones on Android
« Reply #54 on: September 06, 2011, 09:50:22 am »
jPCT doesn't do anything like that. It's not aware of morphs or frames or whatever. Whatever is in the engine is there, because the importer/loader considered it to belong there. If that is wrong, the importer or the file is flawed. The engine itself can't do anything about this.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #55 on: September 06, 2011, 09:56:27 am »
I know, I meant the loader. But what's different in this case from, say, importing an animated MD2 is that not all of the morphs will have been put in the animation "track" (the morphs are there and OgreMax probably exports even the ones that aren't being used in the animation, but I wouldn't know where they would go).

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Loading Bones on Android
« Reply #56 on: September 06, 2011, 09:59:01 am »
AGP can you send me your mesh.xml file?

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #57 on: September 06, 2011, 10:03:03 am »
I can only do it a few hours from now, but sure.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: Loading Bones on Android
« Reply #58 on: September 06, 2011, 04:59:54 pm »
@AGP looking at your mesh.xml, there are 9440 polygons and 28320 (=9440x3) vertices. so none of the vertices is shared among polygons. i don't know what causes this. possibly a problem in your model or in exporter. try playing with options of both

neither jPCT nor Bones has any flaw here. they both process what input is given

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Loading Bones on Android
« Reply #59 on: September 06, 2011, 05:33:11 pm »
OK, but the extra vertices are definitely for the morphs. The model, I assure you, is perfect and has, as I've shown 4800 vertices. I'll ask the developer of OgreMax about this and report what he says.