# The SIMS 1: question on .skn and .cmx formats

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

## Recommended Posts

Hi to All!

I'm programming a tool that allows texturing and modifying Sims 1 meshes in a comfortable way. It's dedicated for anyone who loves Sims 1

But there are few thing, that I can't understand from Sims' .skn and .cmx formats.

Bones are described in adult-skeleton.cmx in the following way:

Name of Bone {ROOT}
Name of Parent Bone {NULL}
X Y Z position {-5.88894e-005} {3.01362} {0.00807638}
Rotation Quaternion {-0.0262998} {-0.706899} {0.0262789} {-0.706336}

Name of Bone {PELVIS}
Name of Parent Bone {ROOT}
X Y Z position {-0.0366778} {-1.72489e-008} {-2.62766e-012}
Rotation Quaternion {0.499999} {0.5} {0.5} {-0.500001}

Name of Bone {L_LEG}
Name of Parent Bone {PELVIS}
X Y Z position {-4.26205e-007} {0.241228} {2.06089e-007}
Rotation Quaternion {0.0137635} {2.41525e-006} {-0.999905} {-3.00579e-007}

So I don't quite understand how to get coordinates of each bone in "(x1,y1,z1)-(x2,y2,z2)" form for that I could draw them in 3d space on my Program's Canvas. Please, see the attachment - I made a picture of what I want to get (I made it in Paint

I'm not as good in High Maths, at the moment I'm studying what quaternions are. I know they describe rotation in 3d space. But how they are used in this situation? That's the information that I couldn't find in the internet.

Thank You

Alex.

##### Share on other sites
in general, V' = q*V[sub]q[/sub]*q[sup]-1[/sup] where V[sub]q[/sub] is the quaternion (w=0,x=V.x,y=V.y,z=V.z), V is some vector (x,y,z) and V' is the rotated V as a quaternion (ignore the W component and it is a vector). From this, you can extrapolate the position of a bone by taking it's root location (which for the root bone is presumably the origin and for each subsequent child bone in the heirarchy is V' for the parent, where V is the end of the bone) and adding its V'.

The final bone position V' minus it's root is the vector you asked for, and V is the position labled X Y Z {numbers}.

I'm very sick and tired right now, so this might be unclear and/or wrong. If someone verifies this, then go with it xD.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 13
• 9
• 11
• 15