• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Importing and animating MDL files in Game Maker

Status
Not open for further replies.
Level 2
Joined
Apr 10, 2016
Messages
12
Hello!
I'm wondering,that how can i load and ANIMATE mdl or mdx model in Game Maker game creation software.I tried to make it myself,i can load mdl models,but the animations are too big task for me.Bezier,hermite,quaternion...i don't know,how to write algorithms for things like that.If anyone here tried to make somthing like that,please give a download link!

Sorry for grammatical problems.

Thanks
 
Level 2
Joined
Apr 10, 2016
Messages
12
I've tried to make an animating system,but in hermite translation algorithms I'm not sure.And quaternion rotations are also complex.I can rotate a bone vector correctly, but as i tried to rotate more bones, they move abnormal. I don't find the problem. And a question:if i tried to rotate a group of vertices connected to a bone,I rotate them around the endpoint of the Parent bone of the rotation bone,or not?

Thanks
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Quaternions and curves are quite simple, you just need to read a little.
You can also check stuff in the 3D viewer's source, granted it's outdated and in Javascript (most of the stuff you'd need is in the math and handlers/mdx directories).
If you are afraid of curves for now, just force linear interpolations.

Can't help you with code, since you didn't post any, but the general gist of skeletal animation is that you start with a root (nodes with an object ID of -1 in Warcraft 3), transform it according to your frame of animation, then go to its children, transform them according to your frame of animation and then also by the parent, and so on, recursively.
When every node has its final transformation (world matrix), you use it to transform attached vertices.
Here's pseudo code assuming everything is stored in standard 4x4 matrices.
Code:
Transformation = Parent * (Translation * Rotation * Scale)

The final position of any vertex is divided by the amount of nodes that affect it.
For example, is you have some vertex V that is attached to two bones, B1 and B2, then the pseudo code will be as follows:
Code:
Position = (B1*V + B2*V) / 2
 
Status
Not open for further replies.
Top