Hi,
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.
Thanks.

Recommended Answers

All 2 Replies

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.

Thanks, but actually I think it might have more to do with the jitter effect described in thi post: http://forums.create.msdn.com/forums/p/59760/367771.aspx. I'm still not sure how to fix it however, as my game requires a large world and altering the camera's near clip plane didn't work for me. Any ideas?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.