Jump to content
  • Advertisement
Sign in to follow this  
The Vaseline Slug

short array to float(angles)

This topic is 2919 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


I'm trying to work out how to convert the angles of a joint in a skelton that is stored in 3 shorts.
I've done a little reading and have found out it is common for 3D assets to store some of the data in shorts to save disk space etc.

The shorts(int16) have the following values.

[font="Times New Roman"]-6967, -6967, -22097[/font] (x,y,z)

These values when converted to double should equal these values.

[font="Times New Roman"]-90.00, -90.00, -55.00 (x,y,z)[/font]

I tried just converting them from shorts to float using the following code:

inline double expandToFloat(short input) {
return ((double)input) * 1000 / 32,767;

Which did not work correct. So I did a little more research and have come to the conclusion it has something to do with: atan2
But I've not been able to work it out / find any examples that seam to work correct.

And no this is not homework, I'm writing a converter that converts a binary format to .ma (Maya acsii)

Any help on this would be great, from documentation on how to do this or pointing in the right direction.

Thx Tom. (sorry if wrong section)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!