<- Download and Install .OSG File Directive ->

Simple usage

Once the osgEphemeris library (osgEphemeris.so) and the osgEphemeris Plugin (osgdb_osgEphemerisModel.so) are installed in the normal search paths for osgDB, osgEphemeris can be used with a simple .osg file. As an example, save the following into a file named ephemeris.osg and use it on the command line with osgviewer. (We'll assume that you will use this file with a piece of terrain, named terrain.osg, which can be confined within a skydome of radius 100000):

    osgEphemerisModel::EphemerisModel {
        Latitude 38.4765
        Longitude -122.493
        SkyDomeRadius 100000

Like this:
        osgviewer --clear-color 0,0,0,1 ephemeris.osg terrain.osg

Note, that it is recommended to use the argument --clear-color 0,0,0,1 which provides a black background as opposed to the OSG bluish default clear color.

Also note that the terrain will be distant and centered from the viewpoint, and probably not visible. The skydome will remain fixed at the eyepoint and will likely obscure the terrain in Trackball mode. Simply pull the terrain database toward the view with the right mouse button, or center the view by typing '3' (to enter 'DriveManipulator mode') followed by the <space> bar.

This example uses three directives in the .osg file: Latitude, Longitude, and SkyDomeRadius. Latitude and Longitude are the position of the viewer on planet earth, given in degrees. Negative values represent South and Western hemispheres respectively. The values given in the example correspond to San Francisco, California.

SkyDomeRadius refers to the size of the skydome's radius. By default, the skydome has a radius of the distance between the earth and the moon, or 384403.0 kilometers. Most terrain databases will become dwarfed by this large sky dome and will probably not even be visible. Set this value to something that is large enough to encompass the terrain you will be viewing, but not so large that it will cause visual anomalies.

For example, if the terrain is a block 25 Km by 25 Km, then set the radius to about 25000 (25 Km - assuming meters as units).

<- Download and Install .OSG File Directive ->