Files
OpenSpace/data/assets/examples/renderable/renderablepointcloud/pointcloud_textured.asset
Emma Broman 86d1b2d8a6 Update pointcloud examples to conform with new example structure (#3213)
* Update pointcloud examples to conform with new example structure and add some new ones

* Update name, GUI path and add title to top comment to match the decided format

* Rename base examples to Basic, as agreed

* Clarify TODO comment about broken label rotation

---------

Co-authored-by: Alexander Bock <alexander.bock@liu.se>
Co-authored-by: Ylva Selling <ylva.selling@gmail.com>
2024-04-30 13:33:18 +02:00

37 lines
1.2 KiB
Lua

-- Textured
-- This example creates a point cloud using a texture to render each point.
--
-- Note that other color related settings, like color mapping, can still be applied.
-- The color will then be multiplied with the texture color.
local Node = {
Identifier = "RenderablePointCloud_Example_Textured",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("data/dummydata.csv"),
Texture = {
-- The path to the texture file. Here we use openspace.absPath so that we can use
-- the ${DATA} token to get the path to a texture in the "OpenSpace/data" folder,
-- but for a file at a relative location it would also work to use asset.resource,
-- like for the data file above
File = openspace.absPath("${DATA}/test3.jpg"),
},
-- Disable additive blending, so that points will be rendered with their actual color
-- and overlapping points will be sorted by depth. This works best when the points
-- have an opacity of 1
UseAdditiveBlending = false
},
GUI = {
Name = "Textured",
Path = "/Examples/RenderablePointCloud"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)