mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-02 16:59:37 -05:00
Issue/1527 - GlobeRotation (#1737)
* Add GlobeRotation and example * Put latitude before longitude in GlobeTranslation files
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local earth = asset.require('scene/solarsystem/planets/earth/earth')
|
||||
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
|
||||
local models = asset.syncedResource({
|
||||
Name = "New Horizons Model",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "newhorizons_model",
|
||||
Version = 2
|
||||
})
|
||||
|
||||
local lat = 40.7306
|
||||
local long = -73.9352
|
||||
|
||||
local Example_GlobeRotation = {
|
||||
Identifier = "Example_GlobeRotation",
|
||||
Parent = earth.Earth.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "GlobeTranslation",
|
||||
Globe = earth.Earth.Identifier,
|
||||
Latitude = lat,
|
||||
Longitude = long,
|
||||
Altitude = 6,
|
||||
UseHeightmap = true
|
||||
},
|
||||
Rotation = {
|
||||
Type = "GlobeRotation",
|
||||
Globe = earth.Earth.Identifier,
|
||||
Latitude = lat,
|
||||
Longitude = long
|
||||
-- Can be used to to put flat on leaning surfaces, but also leads to updating
|
||||
-- the rotation every frame
|
||||
--UseHeightmap = true
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableModel",
|
||||
Body = "NEW HORIZONS",
|
||||
GeometryFile = models .. "/NewHorizonsCleanModel.obj"
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Example"
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { Example_GlobeRotation })
|
||||
@@ -16,8 +16,8 @@ local Example_Fixed_Height = {
|
||||
Translation = {
|
||||
Type = "GlobeTranslation",
|
||||
Globe = earth.Earth.Identifier,
|
||||
Longitude = -74.006,
|
||||
Latitude = 40.7128,
|
||||
Longitude = -74.006,
|
||||
Altitude = 100000.0
|
||||
}
|
||||
},
|
||||
@@ -38,8 +38,8 @@ local Example_Adaptive_Height = {
|
||||
Translation = {
|
||||
Type = "GlobeTranslation",
|
||||
Globe = earth.Earth.Identifier,
|
||||
Longitude = -74.006,
|
||||
Latitude = 40.7128,
|
||||
Longitude = -74.006,
|
||||
UseHeightmap = true
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user