Files
OpenSpace/data/assets/examples/spheres.asset
2022-11-22 21:06:52 +01:00

53 lines
1019 B
Lua

local spheres = {}
local i = 1
for z=1,3 do
for y=1,3 do
for x=1,3 do
local sphere = {
Identifier = "ExampleSphere" .. i,
Transform = {
Translation = {
Type = "StaticTranslation",
Position = { x, y, z }
}
},
Renderable = {
Type = "RenderableSphere",
Enabled = true,
Size = 0.20 + i * 0.01,
Segments = 80,
Opacity = 1,
Texture = openspace.absPath("${DATA}/test2.jpg"),
Orientation = "Both",
},
GUI = {
Name = "Test Sphere " .. i,
Path = "/Other/Spheres"
}
}
table.insert(spheres, sphere)
i = i + 1
end
end
end
asset.onInitialize(function()
for _, n in ipairs(spheres) do
openspace.addSceneGraphNode(n)
end
end)
asset.onDeinitialize(function()
for _, n in ipairs(spheres) do
openspace.removeSceneGraphNode(n)
end
end)
for _, n in ipairs(spheres) do
asset.export(n)
end