Author Topic: Two small questions  (Read 5162 times)

Offline PaldxD

  • byte
  • *
  • Posts: 25
    • View Profile
Two small questions
« on: August 07, 2010, 03:16:24 am »
1st question: I have a small problem related to memory, because I have an md2 file with motion capture to 20000 (20k), to be aware of how much it weighs? Then, this file is a simple ballerina with motion captured by motion capture.
The question here is, to save space there is some other export format that I can use to minimize this problem?

2nd Question: Is there any way to move (move) the vertices of an md2 file (make a kind of customization)?


desculpe meu inglÍs, usei muito o google para traduzir meu texto

Offline paulscode

  • double
  • *****
  • Posts: 863
    • View Profile
    • PaulsCode.Com
Re: Two small questions
« Reply #1 on: August 07, 2010, 01:05:22 pm »
LOL, google sucks at translating Portuguese.  It took me a while to figure out the meaning of your first question.  Is this correct?

Is there a format other than md2 which can save animations, but is smaller?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Two small questions
« Reply #2 on: August 07, 2010, 10:28:40 pm »
Where exactly is the problem with the size of the md2? Storage space or main memory usage? For a keyframe file format, MD2 is already pretty good for storing the files. In main memory, size will be the same no matter which file format you are using. If it's too large, maybe reducing the number of keyframes is an option?

Do you want to manipulate the vertices after loading? If so, you can do this by implementing an IVertexController. However, this is pretty low level and you have to know want you are doing or otherwise you'll screw up the model. In addition, it actually meant to manipulate Object3Ds' meshes, not those from animations. To make the animation meshes accessible, you somehow have to feed mesh after mesh in a kind of dummy Object3D. So yes, it is possible but pretty awkward.

Offline PaldxD

  • byte
  • *
  • Posts: 25
    • View Profile
Re: Two small questions
« Reply #3 on: August 08, 2010, 04:39:33 am »
The problem is the large file md2 with 20000 frames, using 800MB+ ram.
And this file is necessary, because I'm going to use in a presentation


See it http://www.youtube.com/user/paldxd#p/a/u/0/qQjEd8P-Rbg



(it is best to be silent than to speak with any questions!)

:)

I promise to do an English course in the future, hehe!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Two small questions
« Reply #4 on: August 08, 2010, 10:57:39 am »
Well...as long as you are using keyframed animations, there's not much room for improvement memory wise unless you reduce the number of keyframes. You can try to call strip() on the animation. That will reduce memory usage to some degree, but i don't expect it to work a miracle.

Another option would be to switch to skeletal animation using raft's Bones: http://www.jpct.net/forum2/index.php/topic,1503.0.html
However, i can't tell you if this is feasible for your application and what to do exactly to use it...raft has to jump in here... ;)

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Two small questions
« Reply #5 on: August 08, 2010, 11:52:12 am »
Isn't it possible to do some kind of streaming animation?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Two small questions
« Reply #6 on: August 08, 2010, 12:00:21 pm »
I already thought of that during today's running session... ;) It should be possible to add support for that, but it will take some time to do it and i'm not sure if PaldxD can wait that long, if he has to do a presentation. In addition, it somehow feels like a solution for a problem that should better be solved in another way to me, so i consider streaming animations as the last option of all...

Offline PaldxD

  • byte
  • *
  • Posts: 25
    • View Profile
Re: Two small questions
« Reply #7 on: August 08, 2010, 01:12:16 pm »
for now the solution is to reduce the frames?
do not see having a headache with that, the presentation is next month.
Noob mode...
What advantage of using "build" and "buildallobjects"?
and what better time to use compile?

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Two small questions
« Reply #8 on: August 08, 2010, 02:01:47 pm »
Quote
I already thought of that during today's running session...
Ah :)

Quote
In addition, it somehow feels like a solution for a problem that should better be solved in another way to me, so i consider streaming animations as the last option of all...
The video didn't show that many animations which I wouldn't of thought it would be 800 megs in memory. But yeah no one else has asked for this feature, I wouldn't suggest wasting your time if its not going to be used.

Offline PaldxD

  • byte
  • *
  • Posts: 25
    • View Profile
Re: Two small questions
« Reply #9 on: August 08, 2010, 02:39:23 pm »
The video didn't show that many animations which I wouldn't of thought it would be 800 megs in memory.
In this video showing just an animation of 2500 frames, consuming 200mb.

Offline raft

  • quad
  • ******
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: Two small questions
« Reply #10 on: August 08, 2010, 09:25:54 pm »
Another option would be to switch to skeletal animation using raft's Bones: http://www.jpct.net/forum2/index.php/topic,1503.0.html
However, i can't tell you if this is feasible for your application and what to do exactly to use it...raft has to jump in here... ;)

well, if PaldxD can export to a format whch Bones can read, Bones is feasible. exact amount depends on vertex count of model, but i can say memory usage will be much less. Bones stores only keyframes of joints (as opposed to md2 stores vertex keyframes) so the higher the vertex count the bigger the memory gain.

Offline PaldxD

  • byte
  • *
  • Posts: 25
    • View Profile
Re: Two small questions
« Reply #11 on: August 08, 2010, 11:04:38 pm »
Is to extract this format with the blender?

Offline raft

  • quad
  • ******
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: Two small questions
« Reply #12 on: August 08, 2010, 11:15:41 pm »
Bones can import from Collada and OgreXML files.
http://www.aptalkarga.com/bones/#formats

I don't have experience with Blender but I suppose there is an exporter for at least one of these formats. if exists, I suggest OgreXML

even if you can't find an exporter for Blender, try 3dsmax. OgreMax is quite a good exporter for OgreXML

Offline PaldxD

  • byte
  • *
  • Posts: 25
    • View Profile
Re: Two small questions
« Reply #13 on: August 09, 2010, 01:16:05 am »
Raft, I managed to export the mesh and skeleton file...more than .bones
How do?

Offline raft

  • quad
  • ******
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: Two small questions
« Reply #14 on: August 09, 2010, 01:22:20 am »
google translate really sucks :o

you can use the scripts in scripts folder to convert mesh and skeleton files to bones format. assuming you are a windows user, you should use scripts/jmeOgre2Bones.bat file.