I have cpp code that displays simple OpenGL shapes in Maya.
If the legacy viewport is used, then I have precisely what I want : arrows going along the x axis:
However if I use the same code in the ViewPort 2.0 then the arrows are following camera movements:
This is happening only if I apply the glTranslatef (which I will need to use).
This is the piece of code:
for (int i=0;i<10;i++)
{
glPushMatrix();
glTranslatef(i,0,0);
glBegin(GL_LINES);
// Arrow
glVertex3f(0, y, z);
glVertex3f(1, y, z);
glVertex3f(1, y, z);
glVertex3f(0.5, y, z+0.5);
glVertex3f(1, y, z);
glVertex3f(0.5, y, z-0.5);
glEnd();
glPopMatrix();
}
How can I have proper behavior in the "new" Maya viewport ?