Do not cull mjGEOM_TRIANGLE.

PiperOrigin-RevId: 789723631
Change-Id: I8a5aaa78a9fe63458c07b823c7550846c14413b1
This commit is contained in:
Alessio Quaglino
2025-08-01 05:26:48 -07:00
committed by Copybara-Service
parent 3d537c85ef
commit 80befd64ae
2 changed files with 8 additions and 6 deletions
+4 -6
View File
@@ -911,12 +911,10 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
}
// draw triangles, one per side
for (int j = 0; j < 2; j++) {
START
makeTriangle(thisgeom, pos[0], pos[j ? 1 : 2], pos[j ? 2 : 1], rgba);
thisgeom->objid = id;
FINISH
}
START
makeTriangle(thisgeom, pos[0], pos[1], pos[2], rgba);
thisgeom->objid = id;
FINISH
}
}
}
+4
View File
@@ -446,11 +446,15 @@ static void renderGeom(const mjvGeom* geom, int mode, const float* headpos,
break;
case mjGEOM_TRIANGLE: // triangle
glDisable(GL_CULL_FACE);
glBegin(GL_TRIANGLES);
glVertex3f(0, 0, 0);
glVertex3f(size[0], 0, 0);
glVertex3f(0, size[1], 0);
glEnd();
if (scn->flags[mjRND_CULL_FACE]) {
glEnable(GL_CULL_FACE);
}
break;
case mjGEOM_FLEX: // flex