Advertisement

Floating Point Accuracy Problems

Started by October 18, 2002 12:30 PM
1 comment, last by ChromaZ28 22 years, 4 months ago
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?
Try keeping your plane/camera at the origin and moving everything else.

Or try using doubles if you''re only using floats.
Advertisement
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.
Keys to success: Ability, ambition and opportunity.

This topic is closed to new replies.

Advertisement