www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: PaldxD on August 07, 2010, 03:16:24 am

Title: Two small questions
Post by: PaldxD 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
Title: Re: Two small questions
Post by: paulscode 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?
Title: Re: Two small questions
Post by: EgonOlsen 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.
Title: Re: Two small questions
Post by: PaldxD 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!
Title: Re: Two small questions
Post by: EgonOlsen 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 (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... ;)
Title: Re: Two small questions
Post by: zammbi on August 08, 2010, 11:52:12 am
Isn't it possible to do some kind of streaming animation?
Title: Re: Two small questions
Post by: EgonOlsen 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...
Title: Re: Two small questions
Post by: PaldxD 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?
Title: Re: Two small questions
Post by: zammbi 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.
Title: Re: Two small questions
Post by: PaldxD 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.
Title: Re: Two small questions
Post by: raft 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 (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.
Title: Re: Two small questions
Post by: PaldxD on August 08, 2010, 11:04:38 pm
Is to extract this format with the blender?
Title: Re: Two small questions
Post by: raft 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 (http://www.ogremax.com/) is quite a good exporter for OgreXML
Title: Re: Two small questions
Post by: PaldxD on August 09, 2010, 01:16:05 am
Raft, I managed to export the mesh and skeleton file...more than .bones
How do?
Title: Re: Two small questions
Post by: raft 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.
Title: Re: Two small questions
Post by: PaldxD on August 09, 2010, 01:26:45 am
google translate really sucks :o
Sorry.
Title: Re: Two small questions
Post by: raft on August 09, 2010, 01:28:27 am
google translate really sucks :o
Sorry.
don't be. it's not your fault. and even if it sucks, we can still communicate at some level..
Title: Re: Two small questions
Post by: PaldxD on August 09, 2010, 02:41:00 am
-out command help... ???
how to use ?
-in x.mesh.xml -out c:\?
Title: Re: Two small questions
Post by: raft on August 09, 2010, 02:49:39 am
for example:
Code: [Select]
jmeOgre2Bones -out <x.bones> -in <x.mesh.xml>
-in argument should be last since it can take more than many (more than one) parameters (to merge many files into one)
Title: Re: Two small questions
Post by: PaldxD on August 09, 2010, 03:16:02 am
http://rapidshare.com/files/411849631/blend.rar
Check this file,
I replaced the example of skeletalapi ...
was very bad.
=\
my gtalk is paldxd
msn filipe_nirvana@hotmail.com
Title: Re: Two small questions
Post by: raft on August 09, 2010, 03:30:09 am
what exactly is the problem?

there is a strange animation in these files. i don't know how it looks in blender. can you send a movie? if animation doesn't look like the one in blender, you can try an Ogre3D viewer to test if it's exporter fault or not..
Title: Re: Two small questions
Post by: PaldxD on August 09, 2010, 03:38:37 am
http://img441.imageshack.us/f/semttuloss.png/
Title: Re: Two small questions
Post by: raft on August 09, 2010, 03:44:00 am
ok, it looks strange but how does it look in Ogre viewer ? I suspect it's fault of exporter you use..
try downloading ogremax (http://www.ogremax.com) and open your files with the viewer.
Title: Re: Two small questions
Post by: PaldxD on August 09, 2010, 03:57:07 am
This afternoon I try more tomorrow...
I go download 3dmax to test.
Thx.
Title: Re: Two small questions
Post by: PaldxD on August 09, 2010, 04:45:00 am
ok, it looks strange but how does it look in Ogre viewer ? I suspect it's fault of exporter you use..
try downloading ogremax (http://www.ogremax.com) and open your files with the viewer.
You are right...
The problem is exporter... =\
Title: Re: Two small questions
Post by: zammbi on August 09, 2010, 05:31:52 am
When your finished I wouldn't mind knowing the memory(ram) used now.