OpenGL: draw line between two elements
问题 I need to draw a line between two meshes I've created. Each mesh is associated with a different model matrix. I've been thinking on how to do this and I thought of this: glMatrixMode(GL_MODELVIEW); glLoadMatrixf(first_object_model_matrix); glBegin(GL_LINES); glVertex3f(0, 0, 0); // object coord glMatrixMode(GL_MODELVIEW); glLoadMatrixf(first_object_model_matrix); glVertex3f(0, 0, 0); // ending point of the line glEnd( ); But the problem is that I can't call glMatrixMode and glLoadMatrixf