]> Pileus Git - grits/commit
Increase camera angle to 60 degrees
authorAndy Spencer <andy753421@gmail.com>
Fri, 10 Feb 2012 18:26:50 +0000 (18:26 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 12 Feb 2012 06:59:10 +0000 (06:59 +0000)
commit7138d9be203921e2eaa3168932c463ed790456c0
treea1457c2bc0f0d1eea924b1e5cb331d7e1ae4c2c2
parentddec1ba9b0fe842aef5fd0039fd0f79f275c87f1
Increase camera angle to 60 degrees

Using the 30 degree viewing angle looks reasonable realistic,
but is difficult to use since it requires much more panning.

Derivation of FOV_DIST for a 1600x1200 monitor
with a vertical viewing angle of 60 degrees:

        ---  +.
         |   | '-.     angle
  height |   |    '-./
  (px)   |   |      /'-.
         |   +------|---+ (o) eye
         |   |      \ .-'
         |   |     .-'
         |   |  .-'
        ---  +-'

             |----------|
               FOV_DIST (px)

  height   = 1200 px
  angle    =   60 deg
  fov_dist = cot(angle/2)*(height/2) = ~1039.23

Derivation of angle for window of a given height:

  angle    = atan((height/2)/FOV_DIST)*2
src/grits-opengl.c
src/grits-util.h
src/grits-viewer.c