Importing MS3D files, what's next?

Started by
4 comments, last by tpascal 14 years, 9 months ago
I've read and understood NeHe's Lesson 31, which focuses on importing the meshes, materials, ect from a MS3D file, which is great as this is the first 3D model loader I've been able to implement despite a momentous effort on my part. I've gone through line by line of the tutorial to understand it and have successfully implemented it, but it only suggests that skeletal animation will "come later." I understand the basics of skeletal animation, have written my own vector and quaternion classes more times than I care to count, but have no idea how to implement them with respect to MS3D files. An informative tutorial, or a pointer in the right direction, would be greatly appreciated.
Advertisement
I suggest you make your own internal object format and just convert whatever you are loading to that at run time. These support classes you mention vector/quaternion etc should be the same for whatever format you are loading and should only need to be written once. Thats as specific I can get get based on the information given, if you describe your problem in more detail we might be of further help.
You might check out the Cg Tutorial section 6.5 for some information on vertex skinning, which is essentially what you are looking for.
Thank you. For clarity's sake, what JasonZ provided was much like what I'm looking for. Ideally I'd use a shader (I write in GLSL however) to transform the vertex positions to fit the motions of a skeleton. However, this isn't what I need at just this moment, as I have not reached the point where I can translate the vertices via a vertex shader - I can't load the skeletons themselves yet. More over, I'm looking for something a little more focused on the milkshape3D file format. Thank you, though. It's certainly useful to see, and while Cg is a totally different language, translation between the two should not be unfeasible.

Perhaps for even greater clarity, I should explain the entire situation: NeHe's tutorial is a good introduction to importing milkshape3D files, but the class he generates is quite limited. I would like to extend this class to incorporate skeletons, animate them, and render the resulting transformations via a vertex shader. I understand that this is actually three separate steps, but I have never had success reading file format specifications (despite many attempts), and so need a good explanation of how to import the skeletons from milkshape3D files, ideally by extending the NeHe class. Only then can I worry about actually animating them and then rendering them.

Edit: I have a quick question, which may well make my life a lot easier. I'd always (perhaps erroneously) assumed that direct interpolation between the vertex position of two keyframes would yield shoddy results (deformations, irregular movement, ect) and so required the interpolation of bones and then the recalculation of every vertex position based on the interpolated bone positions at every render. This article on Cg suggests otherwise - suggests, in fact, that all one really needs to do is have a collection of keyframes and simply apply a time-dependent weighted blend. If so, this process is much simpler than I envisioned! In fact, as I am not employing inverse kinematics, there is no reason for my application interface with the bones at all. A group of vertex keyframes would be all that was needed (this is starting to sound like the MD2 fileformat...).
Quote:An MS3D viewer written in C++, complete with animation and weighted vertices for the latest file format
from wikipedia :)

I've interpolated between keyframes without any major problems, so if you run into any problems and feel you need to look at some code, my C# code "works" and loads both milkshape ascii and binary, and animates them without glsl.
Hi,

This is the one you are looking for:

http://web.archive.org/web/20010408222059/http://rsn.gamedev.net/tutorials/ms3danim.asp

it is a great tutorial

This topic is closed to new replies.

Advertisement