C++ MD5 implementation
Moderator: Moderators
C++ MD5 implementation
Hello,
I'm working on a MD5 (currently md5mesh only) implementation for spring.
I have some problems to figure out what is what in S3DModel (3DModel.h) and how the "UnitModel-interface" works.
Mainly it is due the lag of comments/documentation (yeah again docs and I know less docs/comments = better programmer) for 3DModel.h and related files...
Due gits log jk wrote this. Jk could you please add more comments or explain me how I can implement my MD5 data structure to the abstract S3DModel?
I'm working on a MD5 (currently md5mesh only) implementation for spring.
I have some problems to figure out what is what in S3DModel (3DModel.h) and how the "UnitModel-interface" works.
Mainly it is due the lag of comments/documentation (yeah again docs and I know less docs/comments = better programmer) for 3DModel.h and related files...
Due gits log jk wrote this. Jk could you please add more comments or explain me how I can implement my MD5 data structure to the abstract S3DModel?
Re: C++ MD5 implementation
S3DModel is the common base for 3DO and S3O models. There are no "3DOModel" or "S3OModel" structures because both formats are piece hierarchies (trees), instead the specialization is present in S3DOPiece and SS3OPiece which extend S3DModelPiece (hence the S3DModelPiece* rootobject). MD5 models, being flat lists of meshes that have no parent / child relationships, do not fit in that design so well, so you'll probably want to insert some higher layer of abstraction above it. (For my own implementation I didn't care to do that part.)
Re: C++ MD5 implementation
Oh did not know that you implemented MD5 in spring, too.
Is it written in Lua or C++?
Is it written in Lua or C++?
Re: C++ MD5 implementation
for the record, RTCW used piece trees IIRC, and it was using md3, so it's not unexplored ground.
Re: C++ MD5 implementation
Well so we need a general abstraction level which could be used for flat based model formats like MD5 and for trees/hierarchies like 3DO, S3O...
Or two abstraction levels....
Hm, need to study some 3D stuff, thought.
Or two abstraction levels....
Hm, need to study some 3D stuff, thought.
Re: C++ MD5 implementation
I don't think we need a new abstraction, AFAIK md5 uses bones which are nothing else than pieces.
But animations need a new system and I don't think adding those is possible with cob. So someone has to code a lua animation system to replace cob.
But animations need a new system and I don't think adding those is possible with cob. So someone has to code a lua animation system to replace cob.
Re: C++ MD5 implementation
Hm, I don't understand the construction of "struct S3DModelPiece", atm.jK wrote:I don't think we need a new abstraction, AFAIK md5 uses bones which are nothing else than pieces.
My vector math is a bit rusty (basically general math, too ) and this also does not help.
I need to relearn it anyway so I will do it next week at work .
Could someone give me a list of thinks which I need to know like:
- Vector
- Quaternions
Re: C++ MD5 implementation
S3DModelPiece doesn't do any math, it just contains the piece information (max/min dims, offset to parent piece, is empty piece) loaded from the file.
The math is done in LocalModelPiece. It is a local instance of the ModelPiece and contains per unit information of the piece instance (position, rotation, hidden, LODs).
Also it doesn't use Quaternions, it uses simple radians for the rotations.
The math is done in LocalModelPiece. It is a local instance of the ModelPiece and contains per unit information of the piece instance (position, rotation, hidden, LODs).
Also it doesn't use Quaternions, it uses simple radians for the rotations.
Re: C++ MD5 implementation
I know that S3DModel(Piece) contains only informations and don't do any math.jK wrote:S3DModelPiece doesn't do any math, it just contains the piece information (max/min dims, offset to parent piece, is empty piece) loaded from the file.
The math is done in LocalModelPiece. It is a local instance of the ModelPiece and contains per unit information of the piece instance (position, rotation, hidden, LODs).
Also it doesn't use Quaternions, it uses simple radians for the rotations.
But I need math to turn md5 flat structure to a tree structure.
MD5 uses quaternions.
Re: C++ MD5 implementation
Joints actually, the bones are implicit. But each joint only knows its parent joint (not vice versa), so the transformations cannot be applied the same way as in 3DO/S3O.jK wrote:I don't think we need a new abstraction, AFAIK md5 uses bones which are nothing else than pieces.
Indeed, animation control is the big sticking point. Making a player for them isn't so difficult (mine is mostly done, IIRC I had only blending left to add), but feeding it commands from the simulation would take more effort.jK wrote: But animations need a new system and I don't think adding those is possible with cob. So someone has to code a lua animation system to replace cob.
Agon: it's in C++, with a small quaternion library (which I'll integrate into Spring if you plan on continuing your work).
Re: C++ MD5 implementation
If you already started work on MD5 for spring in C++ I don't need to add another implementation. It would be more efficient to help you or continue your work.Kloot wrote: ...
Agon: it's in C++, with a small quaternion library (which I'll integrate into Spring if you plan on continuing your work).
How much did you finished?
Yes, I plan to continue the work, the library would help.
Re: C++ MD5 implementation
If I understand correctly, from what little I know a call lua_*-like hack from COB could work... e.g. call md5anim_do_stuff()Kloot wrote:Indeed, animation control is the big sticking point. Making a player for them isn't so difficult (mine is mostly done, IIRC I had only blending left to add), but feeding it commands from the simulation would take more effort.
Re: C++ MD5 implementation
oooh shiny.
that link was posted on reddit, so i only copypasted it here. never doubted there are better options out there ^^ edit: it's BSD...
that link was posted on reddit, so i only copypasted it here. never doubted there are better options out there ^^ edit: it's BSD...
Re: C++ MD5 implementation
License page says:
"ASSIMP is released as Open Source under the terms of a 3-clause BSD license."
the "3-clause BSD license" is a modified BSD license, which is GPL compatible ^-^
"ASSIMP is released as Open Source under the terms of a 3-clause BSD license."
the "3-clause BSD license" is a modified BSD license, which is GPL compatible ^-^
Re: C++ MD5 implementation
tried to google it and it wasn't so clear to me, but if it really is compatible, then "^_^" indeed
anyway, how's Kloot's work on md5? did it go out of lua stage?
anyway, how's Kloot's work on md5? did it go out of lua stage?
Re: C++ MD5 implementation
BSD is the one that lets you do anything, even pull it into closed source...
Re: C++ MD5 implementation
still the original BSD license is GPL incompatible