Skip to main content
gamedev.net
🔒 Locked

Attaching an Object

Started by psyjax 3 replies 900+ views
Original Post
psyjax
psyjax
My engine currently supports animation through linear interpolation. I really want to keep it this simple (i.e. i don't want to do anything with bones and IK's etc.). In any case, the player has the ability to choose from various weapons. Guns, swords, axes, etc. and they need to appear in his hand when he as them equipped. Currently I have three options on the table: 1) - Model the character with each individual weapon. Pros: A quick solution. Cons: Time consuming, memory-inefficient, and generally pretty lame. 2) - Model the character with his various poses and get the key frames. Then, model the weapon “floating” as if it were in the characters hand and export those key frames as well. Super impose the two to get a “holding-effect”. Pros: separates the character from the weapon so the weapons can be easily swapped with out the need for a whole new character mesh. Cons: Memory inefficient when it comes to the weapon models since they need to be key framed as well. That's all I got right now. Can anyone give me additional suggestions or point me in the direction of a good tutorial. Remember, I am seeking to use only Linear interpolation for this project.
Rasmadrak
Rasmadrak
store two vertexes inside the model.

read back these at run/animation time.

Position sword at points (using the differences between the two points to rotate the sword)
"Game Maker For Life, probably never professional thou." =)
psyjax
psyjax
Quote:
Original post by Rasmadrak
store two vertexes inside the model.

read back these at run/animation time.

Position sword at points (using the differences between the two points to rotate the sword)


Ah excelent! ... I'm new to all this, but you sound like your on the right track. Can you elaborate a bit more on the technique you are discribing?

Again, thank you very much for at least setting me on the right track :)
Nit
Nit
I've been down this road before. For my first attempt, I did something similar to your second suggestion, but this seemed like it was still a hack to me.

The solution I am using now seems to be the way to go. Scrap the vertex interpolation models (meant no more md2 models for me), and move over to skeletal animation. I use the milkshape3d format (.ms3d) for my skeletal animations. And more information can be found at http://rsn.gamedev.net, http://en.wikipedia.org/wiki/Skeletal_animation , and at http://www.milkshape3d.com.

All you need to do is attach the joint of the weapon to the joint of the hand, and you are in business.
psyjax
psyjax
Quote:
Original post by Nit
I've been down this road before. For my first attempt, I did something similar to your second suggestion, but this seemed like it was still a hack to me.

The solution I am using now seems to be the way to go. Scrap the vertex interpolation models (meant no more md2 models for me), and move over to skeletal animation. I use the milkshape3d format (.ms3d) for my skeletal animations. And more information can be found at http://rsn.gamedev.net, http://en.wikipedia.org/wiki/Skeletal_animation , and at http://www.milkshape3d.com.

All you need to do is attach the joint of the weapon to the joint of the hand, and you are in business.


I really don't wan't to get into a bone system for this project for two reasons:

1) the models are reletively small, and the project reletively simple. I don't require elaborate animations or complex character meshes.

2) while I could invest the time and effort into a bones system, I don't feel it is necissary. The engine is solid and stable as is, it is not feasable at this moment to extend the dev. time.

I understand that bones are the way to go for more complex stuff, but they are way out of scope for the project at hand. In any case Rasmadrak made a tantilizing suggestion. I am going to see if I can find more on this technique.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.