Page 1 of 1

Default fov

Posted: 27.08.2005, 07:58
by Brendan
Where is the default field of view of 25 something degrees set? I looked in start.cel, celestiacore.cpp, observer.cpp, simulation.cpp and render.cpp and only found numbers for a 45 degree fov.

I'll use this to set up '|' to reset the fov to the default value so I won't need to take a long time to zoom out from close to the minimum fov. The '|' key is also the '\' key so the key would both reset time to the default rate and reset the fov to the default value.

Posted: 27.08.2005, 11:31
by selden
My understanding is that the default field of view is calculated from the physical size of the display (if it's available from the O/S) and the size of the window that Celestia is opening on it. It's different on different computers.

Posted: 27.08.2005, 17:00
by hank
My (admittedly somewhat vague) recollection is that the initial fov is based on the physical size of the window, which is calculated from the window size in pixels and the resolution of the display in pixels per inch (cm?), with an assumption as to the viewing distance.

- Hank

Posted: 27.08.2005, 19:09
by t00fri

Code: Select all

void CelestiaCore::setFOVFromZoom()
{
    for (std::vector<View*>::iterator i = views.begin(); i < views.end(); i++)
        if ((*i)->type == View::ViewWindow)
        {
            double fov = 2 * atan(height * (*i)->height / (screenDpi / 25.4) / 2. / distanceToScreen) / (*i)->zoom;
            (*i)->observer->setFOV((float) fov);
        }
}


FOV is certainly a variable that is computed from the active window height assuming a standard distance from the monitor screen. This became particularly relevant in connection with introducing /multiviews/ a long time ago. The default value may be reset from celestia.cfg.

I had originally introduced the FoV toggle operation for the middle mouse button between the actual zoom position and the standard value. But I assume everybody is aware of that functionality. Christophe generalized the stuff to multiviews.

Bye Fridger

Posted: 27.08.2005, 21:28
by hank
t00fri wrote:I had originally introduced the FoV toggle operation for the middle mouse button between the actual zoom position and the standard value. But I assume everybody is aware of that functionality.


Not everyone has three buttons on their mouse. ;-)

- Hank

Posted: 27.08.2005, 22:51
by t00fri
hank wrote:
t00fri wrote:I had originally introduced the FoV toggle operation for the middle mouse button between the actual zoom position and the standard value. But I assume everybody is aware of that functionality.

Not everyone has three buttons on their mouse. ;-)

- Hank


Is there really still anyone around without a /wheel/ mouse? If so --> buy a new one for 10$. If people don't have a 3d card, Celestia also does'nt work ;-)

Pushing on the wheel is what toogles the fov from zoom to normal and back.

But I think mouse drivers can always emulate the middle button. At least my Logitech driver does.


Bye Fridger

Posted: 28.08.2005, 02:11
by ElChristou
t00fri wrote:...Is there really still anyone around without a /wheel/ mouse? ...


Most of osX users use a 1 button mouse... (so the whell...) :wink:

Posted: 28.08.2005, 10:42
by selden
Wheel mouse for Macs:

http://www.apple.com/mightymouse/

Posted: 28.08.2005, 14:11
by Brendan
Oh, I thought the middle button still changed the fov to the standard value. Now that it goes back to the default fov, the | key can be saved for something else.