GlobeRotation
Inherits Rotation
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The globe on which the longitude/latitude is specified |
|
A valid scene graph node with a RenderableGlobe |
No |
|
A rotation angle that can be used to rotate the object around its own y-axis, which will be pointing out of the globe’s surface |
|
Value of type ‘Double’ |
Yes |
|
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 |
|
Value of type ‘Double’ |
Yes |
|
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 |
|
Value of type ‘Double’ |
Yes |
|
If this value is ‘true’, the lat and lon are updated to match the camera |
|
Value of type ‘Boolean’ |
Yes |
|
If set to true, the heightmap will be used when computing the surface normal. This means that the object will be rotated to lay flat on the surface at the given coordinate and follow the shape of the landscape |
|
Value of type ‘Boolean’ |
Yes |
Inherited members from Rotation
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The type of the rotation that is described in this element. The available types of rotations depend on the configuration of the application and can be written to disk on application startup into the FactoryDocumentation |
|
Must name a valid Rotation 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}