GlobeTranslation

Inherits Translation

Members

Name

Documentation

Type

Description

Optional

Globe

The globe on which the longitude/latitude is specified

String

A valid scene graph node with a RenderableGlobe

No

Altitude

The altitude in meters. If the ‘UseHeightmap’ property is ‘true’, this is an offset from the actual surface of the globe. If not, this is an offset from the reference ellipsoid. The default value is 0.0

Double

Value of type ‘Double’

Yes

Latitude

The latitude of the location on the globe’s surface. The value can range from -90 to 90, with negative values representing the southern hemisphere of the globe. The default value is 0.0

Double

Value of type ‘Double’

Yes

Longitude

The longitude of the location on the globe’s surface. The value can range from -180 to 180, with negative values representing the western hemisphere of the globe. The default value is 0.0

Double

Value of type ‘Double’

Yes

UseCamera

If this value is ‘true’, the lat and lon are updated to match the camera

Boolean

Value of type ‘Boolean’

Yes

UseCameraAltitude

If this value is ‘true’, the altitude is updated to match the camera

Boolean

Value of type ‘Boolean’

Yes

UseHeightmap

If this value is ‘true’, the altitude specified in ‘Altitude’ will be treated as an offset from the heightmap. Otherwise, it will be an offset from the globe’s reference ellipsoid. The default value is ‘false’

Boolean

Value of type ‘Boolean’

Yes

Inherited members from Translation

Name

Documentation

Type

Description

Optional

Type

The type of translation that is described in this element. The available types of translations depend on the configuration of the application and can be written to disk on application startup into the FactoryDocumentation

String

Must name a valid Translation type

No

Asset Examples

 1local sun = asset.require("scene/solarsystem/sun/transforms")
 2local earth = asset.require("scene/solarsystem/planets/earth/earth")
 3
 4
 5
 6local models = asset.resource({
 7  Name = "New Horizons Model",
 8  Type = "HttpSynchronization",
 9  Identifier = "newhorizons_model",
10  Version = 2
11})
12
13
14local ExampleGlobeRotation = {
15  Identifier = "ExampleGlobeRotation",
16  Parent = earth.Earth.Identifier,
17  Transform = {
18    Translation = {
19      Type = "GlobeTranslation",
20      Globe = earth.Earth.Identifier,
21      Latitude = 40.7306,
22      Longitude = -73.9352,
23      Altitude = 6,
24      UseHeightmap = true
25    },
26    Rotation = {
27      Type = "GlobeRotation",
28      Globe = earth.Earth.Identifier,
29      Latitude = 40.7306,
30      Longitude = -73.9352
31      -- Can be used to to put flat on leaning surfaces, but also leads to updating
32      -- the rotation every frame
33      --UseHeightmap = true
34    }
35  },
36  Renderable = {
37    Type = "RenderableModel",
38    GeometryFile = models .. "NewHorizonsCleanModel.obj",
39    LightSources = {
40      sun.LightSource
41    }
42  },
43  GUI = {
44    Path = "/Example"
45  }
46}
47
48
49asset.onInitialize(function()
50  openspace.addSceneGraphNode(ExampleGlobeRotation)
51end)
52
53asset.onDeinitialize(function()
54  openspace.removeSceneGraphNode(ExampleGlobeRotation)
55end)
56
57asset.export(ExampleGlobeRotation)
58
59
60asset.meta = {
61  Name = "Model Example",
62  Version = "1.0",
63  Description = [[An example that demonstrates how to load a 3D model from a geometry
64    file, together with some basic functionality. The model is placed on the surface
65    of a planet using a GlobeRotation and GlobeTranslation.]],
66  Author = "OpenSpace Team",
67  URL = "http://openspaceproject.com",
68  License = "MIT license"
69}