Files
OpenSpace/data/assets/examples/renderable/renderabledisc/disc.asset
Emma Broman c4cf883ec9 Docs and examples for RenderableDisc (#3482)
* Add description and update GUI property values

* Add examples with a single color

* Remove old example file

* Rename ellipse example and remove width

* Apply suggestions from code review

Co-authored-by: Ylva Selling <ylva.selling@gmail.com>

* Address review comments

* Also update renerable description

---------

Co-authored-by: Ylva Selling <ylva.selling@gmail.com>
2025-01-17 14:16:01 +01:00

31 lines
748 B
Lua

-- Basic
-- This example creates a disc with a single color and a radius of 100 meters.
--
-- This renderable requires a texture to be loaded, even for just a single color. Use the
-- utility function that exists for creating single color textures for this purpose.
local cyanTexture = openspace.createSingleColorImage(
"example_disc_color_cyan",
{ 0.0, 1.0, 1.0 }
)
local Node = {
Identifier = "RenderableDisc_Example",
Renderable = {
Type = "RenderableDisc",
Size = 100.0,
Texture = cyanTexture
},
GUI = {
Name = "RenderableDisc - Basic",
Path = "/Examples"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)