Draw a square onto a plane?

Discussion in 'Visualization' started by Keven Wang, Nov 7, 2017.

  1. Hi, I have a plane <geom>. I want to draw a square on it, and change the 2D position programmatically. The drawn square should not take 3D space and therefore will not collide with other bodies. How could I accomplish that?
     
  2. Emo Todorov

    Emo Todorov Administrator Staff Member

    You could create a texture that is mapped to your geom, and they change the texture dynamically; see mjr_uploadTexture.

    But it may be easier to create a site, with the shape of a box but very thin in one dimension, and then change the site position in mjModel as needed.