mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-06 19:49:36 -06:00
53 lines
1019 B
Lua
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
|