I'm an amateur programmer developing a 3d asteroid/space based game in xna. In my game I have a ship with a chase camera attached to it. Attached to the camera (and here I mean its position is calculated relative to the camera) is an arrow model that always points towards the home planet in the game. The arrow works well, but if I get far enough away from the planet it starts shaking, most likely because the immense distances between the planet and the arrow are causing inaccuracies in its calculated position. Is there any way to stop this from happening? I tried having the ship stay still and have all the other models move instead -and this fixed the problem, but it also messed with some of the particle effects I've implemented and with other game logic. I would prefer not to go this route if at all possible.

Edited by cdock13: I forgot to mention that the game is 3d

6 Years
Discussion Span
Last Post by cdock13

Round the number to a fixed number of decimal places. This will stop slight variations in values from having an effect on what you are doing.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.