rdeits / MeshCat.jl

WebGL-based 3D visualizer in Julia
MIT License
233 stars 42 forks source link

Set PointsMaterial vertexColors default to 0 to display proper color #206

Open jshahbazi opened 2 years ago

jshahbazi commented 2 years ago

The vertexColors default is currently set to 2, which makes the color always black regardless of what the color property is set to. Setting the value to 0 allows the proper color to be shown.

nhz2 commented 2 years ago

Thank you for figuring out how to get the right color to show for point clouds of uniform color.

However, I tried it out, and setting vertexColors to 0 will also prevent each point from having a unique color, like in the example in demo.ipynb

colors = reinterpret(RGB{Float32}, points); # use the xyz value as rgb color
setobject!(vis[:pointcloud], PointCloud(points, colors))