Page 1 of 1

weapon+md2 model???

Posted: Mon Apr 12, 2004 5:23 am
by freestyle
how can i put the weapon in the hand of a md2 model???
and can u tell me that how i can change the weapons in game?
thx

Posted: Mon May 10, 2004 8:53 am
by jordanXXX
I wanna know ....:)

who can help us ?

md3 ???

Posted: Mon May 10, 2004 9:52 pm
by Electron
I do not know if this is possible with .md2, I can't think of a way. Is easy with .x, .ms3d, or .md3(though this is not natively supported by Irrlicht :( )

Posted: Tue May 11, 2004 6:13 pm
by Guest
So overall, would .x handling be easier in the environment, i.e. holding stuff, movement...etc? I'm debating whether or not to use md2's or .x models for my game.

Posted: Tue May 11, 2004 7:47 pm
by Electron
Well, .x is a more up to date format than the somewhat old .md2 and I definitely think holding stuff would be much easier with .x. One thing to be aware of though is that .x uses skeletal animation (as opposed to morph animation used by .md2 or .md3) whcih gives it greater flexibility (well Irrlicht can't take advantage of this yet, but it is possible to manipulate the skelton in real-time for ragdolls). However, the flexibility of a skeletal animation system has a downside, vertices are generally computed in real time (the .x file does not store verties for every frame), meaning increased CPU time. Another downside to .x, though not with the format itself, is that there does not seem tobe a wealth of free tools that export .x, at least not with bones and weights. CharacterFX (which is $15 I think and is supposed to be good for animation) I believe has .x export. Blender can export .x to some extent, but not yet with bones and weights (I'm not sure if it can export any animation at all since I thought skeletal animation had to be done with bones and weights, but I'm not too sure on that). My hopes are on blender, a bones and weights .x export is supposedly in the works, I jsut hope it doesn't take too long. Too bad gmax doesn't have a .x export and that the TrueX plugin for Truespace doesn't work with the free version 3 of Truespace (that's what I heard anyway). I too have been thinking a lot lately about what model format to use, hence the rambling.

Posted: Wed May 12, 2004 3:58 pm
by arras
Character FX works fine exporting x files with animation.
Another program which have good x export is Milkshape ...it doesnt have weighted wertices yet.

Posted: Wed May 12, 2004 11:23 pm
by Masdus
with md2 models you cannot simply attach a weapon to the model in the game. The weapon needs to be part of the model when you make it in your modeling program.

Posted: Thu May 13, 2004 8:38 pm
by Electron
Which is of course rather limiting

Posted: Fri May 14, 2004 3:36 am
by Domarius
Which leaves you with the options of;

Modelling a 'generic weapon' that your character holds, to represent all weapons, or

Making some system where you can put a weapon in their hands using code - like making it so their hold the gun dead still as they do their run or walk animation, then you could just set the gun to their position, with an offset.

Posted: Fri May 14, 2004 4:08 am
by guest1
the way they did it in Quake3 -- I dunno about the other ones, is they used a single triangle to define the location of where the gun will be attached. This is rather difficult to code because it requires you to (during the model load) go through and get the mesh buffer for every frame, find that polygon (it'll be the only one with a certain size and a 90 right angle) and get the position of it, and then also grab the vector of the two vertexes and convert that to a euler angle to setRotation on your model (also setPosition) -- all of these rotations and positions need to be set in an array, so when you set the frame for animation, you're also going to set the position and the rotation of the gun based on the corrisponding one in the array.

Hope this helps.

Posted: Fri May 14, 2004 5:16 am
by keless
However, the flexibility of a skeletal animation system has a downside, vertices are generally computed in real time (the .x file does not store verties for every frame), meaning increased CPU time.
This isnt so much an issue with modern video cards-- typically this is handled on the video card using an ARB function (in OGL) or some other name in DirectX. Depends on how Niko implemented it in Irrlicht as to whether or not Irrlicht can take advantage of this however.

Posted: Fri May 14, 2004 6:58 am
by puh
As far as I know the only function in Irrlicht used for attaching weapon is:
irr::scene::IAnimatedMeshMS3D::getMatrixOfJoint
irr::scene::IAnimatedMeshX::getMatrixOfJoint
From API: Returns a pointer to a transformation matrix of a part of the mesh based on a frame time. This is used for being able to attach objects to parts of animated meshes. For example a weapon to an animated hand.