Sign in to follow this  

Skeleton and its Mesh

This topic is 4731 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, Im not quite up with all my math, but im working with a modified hl2 smd exporter to export from 3dsmax. I export and render skeleton fine, I also can export the faces/verts fine. The only problem is they are in there won Object Space which means while i know which parent they are related to for bones. I need to convert it from the meshes object space to the specific bones space don't I? How else would I be able to use the rotatiosn and transformation of the skeleton to move the verticies? Thanks for all your input this is my final hurdle I hope -Maz

Share this post


Link to post
Share on other sites
I have to test this, but i had an idea.
Since all my faces/verts are in world space, but all my bones are in local space. I need to find the world space of my bones. For each bone I would start at the origin as the vertex. Then multiply that vertex throughout the bone structure until I reached the bone I wanted. The resulting vertex would be the world space correct? Then I would just do that for 2 keyframes, Subtract the difference in where the vertices were and then add that to each mesh vertex that had the bone as its parent?

OR

In the 3dsmax exporter to get the bones into there own local space i have
Matrix3 mat3NodeTM = pnode->GetNodeTM(m_tvToDump);
Matrix3 mat3NodeLocalTM = mat3NodeTM * Inverse(mat3ParentTM);

I assume the first line get the bones world space?
Then to get the local you just mult the world space by the inverse of the parent??

Will either of these work?

-Maz



Share this post


Link to post
Share on other sites
Guest Anonymous Poster
to translate world coordinates into bone coordinates, you have to do:
Local Coord Point = InvMatBone * World Coord Point;
InvMatBone is the inverse of the bone matrix.

in your case, get the Matrix of your bone in object space, inverse it, and multiply it by the world coordinates.

Share this post


Link to post
Share on other sites
Ok, im not able to export the matrix based off the origin, not the parent, but now my problem is more Converting the vertex from world space to the bones specific local space, so would i multiply the inverse of the bones matrix by the vertex? Ill try it and hopefully it will work??


Also for Dan

Its in the SDK, which well as long as you have purchased HL2 you get access to them, they are also im pretty sure the same as HL1 except you can use multiple bones per vertex. The SDK has the source to the .smd exporter. Its very simple, the one part that is complicated is the studiomdl, which is what converts the raw .smd data into the .mdl data for HL. Im trying to use the smd exporter to then pretty much create my own format but simpler. Im mainly using it as refernce becuase its hard to find info on the max sdk. If you need any help with it i shoudl be able to try to lend you a hand

-Maz

Share this post


Link to post
Share on other sites
If you created a mod, or told it to create a mod and everything, i created mine with testmod name
C:\TestMod\src\utils\smdlexp
that is where the exporter source is. so its in your mod directory/src/utils/smdlexp

just incase you can't find it

Share this post


Link to post
Share on other sites

This topic is 4731 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this