Files
OpenSpace/data/assets/examples/renderable/renderablepointcloud/pointcloud_textured.asset
Emma Broman fcba068aca Add a point cloud example that changes the point orientation (#3327)
* Add a point cloud example that changes the point orientation

Note that it is really difficult to see what is going on without a texture, so added a texture to this exmaple as well.

* Apply suggestions from code review

Co-authored-by: Alexander Bock <alexander.bock@liu.se>

* Update example identifier to be unique

---------

Co-authored-by: Alexander Bock <alexander.bock@liu.se>
2024-06-26 10:44:09 +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 = "RenderablePointCloud - Textured",
Path = "/Examples"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)