ros-visualization / rviz

ROS 3D Robot Visualizer
BSD 3-Clause "New" or "Revised" License
831 stars 463 forks source link

Add background overlay under text view facing #1833

Closed ClementLeBihan closed 3 months ago

ClementLeBihan commented 4 months ago

Hi, I am trying to add a background rectangle behind the text view facing to make it more readable. Do you have any advice to do so ? Best, Clément

rhaschke commented 4 months ago

What kind of advice you are looking for? Just draw a rectangle at the right location?

ClementLeBihan commented 4 months ago

I do not know what is the proper way using Ogre to display Text with an overlay. If this is already possible with Ogre or if I need to create a rectangle behind the text.

rhaschke commented 4 months ago

I don't know this by heart too. You will need to consult the docs.

ClementLeBihan commented 4 months ago

I can see a mpBackgroundMaterial variable in movable_text header but never used. Is it here to do what I want ?

ClementLeBihan commented 4 months ago

I'm trying to understand how the movable_text. It use vertexData that are filled with POS and Texture cordinates for each letter of the text, refering the material. Do you guys know if it's possible to add extra vertex that doesn't contain texture cordinates to draw a rectangle ? To mix vertex format in a certain way (letters vertex and triangle vertex). I can't make it work on my side.

ClementLeBihan commented 3 months ago

I succeed to make it work adding new vertex corresponding to the background rectangle I wanted to display. I didn't find a way to avoid using POS + TEXTURE, so I found a trick where I choose the middle of a letter to display a full black rectangle ...