Archived

This topic is now archived and is closed to further replies.

ChromaZ28

Floating Point Accuracy Problems

Recommended Posts

I''m writing a flight sim. And my problem is the world scale. Right now I''m using 1 unit = 1 meter. My aircraft starts at 0,0,0. I have the camera parented to the aircraft. Now when I get say 1000 units or more from 0,0,0 I notice the plane starts to shake and gets worse the further I get from 0,0,0. It seems like a floating point problem. I''ve tried it with different scales to such as 1 unit=10 meters and 1unit=100 meters. Anyone know how to get the jitters to stop?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try keeping your plane/camera at the origin and moving everything else.

Or try using doubles if you''re only using floats.

Share this post


Link to post
Share on other sites
Maybe you are flying to fast for the air frame :-) It could be an orthogonalization problem. Alternatively it could be a problem with your depth buffer. If it is orthogonalization you can simply reorthogonalize every so many frames or build the transform matrix every frame. If it is the depth buffer I believe the best solution is to move the camera back from the screen. The ratio of z-far to z-near determines how many bits you lose in the depth buffer with the larger the ratio the more bits you lose.

Share this post


Link to post
Share on other sites