Jump to content
  • Advertisement
Sign in to follow this  
pix0l

Floating point fun

This topic is 4893 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 just spent several laborious hours debugging some rotation code I wrote. I must have gone over my algorithm 5000 times during this span, unable to figure out what was wrong. I'm trying to make a boxing game with very little knowledge of math. Anyway I was trying to get the boxers to rotate so that they remain facing each other as they move around the ring. It worked for the most part but at a certain point the rotation would go nutty on me and the boxer would rotate the longer way to get to the same place. After all my second guessing of my math code etc it turns out the problem was I was ignorantly comparing two floating point values for equality and getting inconsistent results, screwing things up. Doh! This is my first real attempt at anything 3D and I guess I forgot about floating point issues. This is my pointless celebration thread. Feel free to post any similar pointless rants.

Share this post


Link to post
Share on other sites
Advertisement
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!