2

I'm trying to convert a 3d point cloud to an ElevationGrid node.

Each point of the cloud has a color, so I thought that I could use color and colorPerVertex fields of ElevationGrid, but I don't think Webots renders the colors.

What am I missing?

The solid node I tested is:

Solid {
  children [
    Shape {
      geometry DEF BB ElevationGrid {
        color Color {
          color [
            1 1 1
            0 0 0
            1 1 1
            0 0 0
            1 1 1
            0 0 0
          ]
        }
        height [
          0, 0.1, 0, 0.1, 0, 0.1
        ]
        colorPerVertex FALSE
        xDimension 3
        zDimension 2
      }
    }
  ]
}
Inbae Jeong
  • 4,053
  • 25
  • 38

1 Answers1

1

It seems to be a bug in Webots R2019a. According to the documentation, it should work as you expect it. But the color field appears to be ignored. I would suggest you the following workaround: generate a texture that contains the colors you need and map this texture on the ElevationGrid node (you will need to add an Appearance node to the Shape node to so it).

Olivier Michel
  • 755
  • 6
  • 10
  • 1
    I guess you meant ElevationGrid, not IndexFaceSet. I prefer colored vertices, but it seems that using texture is the only option now. Will it be fixed? or removed? – Inbae Jeong Jan 11 '19 at 15:29
  • 1
    Yes, sorry. I just fixed it (ElevationGrid instead of IndexedFaceSet). I am not sure when that will be fixed. If some of our paying customers ask for it, we will fix it. Otherwise, it will be removed. – Olivier Michel Jan 14 '19 at 16:11