Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am curious to what standard values I should use to create a camera's projection matrix, as well as if certain measurements need to be taken if I want to represent a very small world or a very big world and make it feel natural.

What values (field-of-view, nearplane, farplane) to construct a projection matrix should be used if:

  • 1 unit to represent 1 meter?
  • 1 unit to represent 1 cm?
  • 1 unit to represent 100 meter?
share|improve this question

1 Answer 1

up vote 3 down vote accepted

What values should be used for the near and far planes depends entirely on your scene. It doesn't matter what units you're using, as long as the near and far planes are specified in the same units as everything else.

  • Set the field of view to whatever you think looks good.

  • Set the near plane as far as you can get away with - as far as you can make it without causing obvious clipping when the camera gets close to a wall, etc.

  • The far plane setting doesn't matter very much. Set it as far as you need to fit your scene, or even make it infinite (which generates a perfectly valid projection matrix; counterintuitively, it can even be more precise than a finite one, over most of the depth range).

share|improve this answer
1  
Just note that Z buffer will be distributed between near/far clipping planes and too big span can cause Z-fighting on distant objects. In that case you would need to allocate more bits to Z buffer (24, 32) or reduce the scale. –  Krom Stern May 20 '13 at 4:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.