Default fov

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
Brendan
Posts: 296
Joined: 15.07.2003
With us: 21 years 4 months
Location: Bellows Falls, VT
Contact:

Default fov

Post #1by Brendan » 27.08.2005, 07:58

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.

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #2by selden » 27.08.2005, 11:31

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.
Selden

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #3by hank » 27.08.2005, 17:00

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

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #4by t00fri » 27.08.2005, 19:09

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

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #5by hank » 27.08.2005, 21:28

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

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #6by t00fri » 27.08.2005, 22:51

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

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #7by ElChristou » 28.08.2005, 02:11

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:
Image

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #8by selden » 28.08.2005, 10:42

Wheel mouse for Macs:

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

Topic author
Brendan
Posts: 296
Joined: 15.07.2003
With us: 21 years 4 months
Location: Bellows Falls, VT
Contact:

Post #9by Brendan » 28.08.2005, 14:11

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.


Return to “Development”