glut library and matlab for general case