Files
OpenSpace/data/assets/examples/screenspacerenderable/screenspacerenderablerenderable/renderablerenderable_model-distance.asset
2025-04-01 12:45:35 +02:00

42 lines
1.2 KiB
Lua

-- Model Distance
-- Creates a screen space window into which 3D model of the Eiffel tower is rendered. As
-- the objects are rendered in meter scale, and the Eiffel tower is about 300m tall, we
-- place the camera at a great distance to be able to see the entire Eiffel tower at the
-- same time.
-- Download the model file for the Eiffel tower
local modelFolder = asset.resource({
Name = "Scale Eiffel Tower",
Type = "HttpSynchronization",
Identifier = "scale_model_eiffel_tower",
Version = 1
})
local Object = {
Type = "ScreenSpaceRenderableRenderable",
Identifier = "ScreenSpaceRenderableRenderable_Example_ModelDistance",
Renderable = {
Type = "RenderableModel",
GeometryFile = modelFolder .. "eiffeltower.osmodel",
RotationVector = { 0.0, 45.0, 0.0 },
LightSources = {
{
Identifier = "Camera",
Type = "CameraLightSource",
Intensity = 5.0
}
}
},
Scale = 1.25,
CameraPosition = { 0.0, 3500.0, 9000.0 },
CameraCenter = { 0.0, 2750.0, 0.0 }
}
asset.onInitialize(function()
openspace.addScreenSpaceRenderable(Object)
end)
asset.onDeinitialize(function()
openspace.removeScreenSpaceRenderable(Object)
end)