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>
This commit is contained in:
Emma Broman
2024-06-26 10:44:09 +02:00
committed by GitHub
parent 55e196e351
commit fcba068aca
2 changed files with 38 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ local Node = {
-- 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"),
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

View File

@@ -0,0 +1,37 @@
-- Orientation - Face Camera Position
-- This example creates a point cloud where the planes that make up the points are
-- oriented to face the camera position, rather than the view direction (which is
-- default). This means that the point will be layed out in a spherical way around the
-- camera, which works better for spherical displays compared to the default
-- orientation.
--
-- A texture is added so that we can more easily see how the orientation is altered.
-- See Textured example for more details.
local Node = {
Identifier = "RenderablePointCloud_Example_FaceCameraPosition",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("data/dummydata.csv"),
-- Change the orientation render option to face the camera position instead
-- of its view direction
OrientationRenderOption = "Camera Position Normal",
-- Add a texture so we can more easily see how the orientation is changed
Texture = {
File = openspace.absPath("${DATA}/test3.jpg")
},
UseAdditiveBlending = false
},
GUI = {
Name = "RenderablePointCloud - Face Camera Position",
Path = "/Examples"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)