0
我得到這個錯誤(注意代碼是從openGL的紅色書:glfloat python的語法錯誤?
GLfloat mat_specular[] = { 0.8, 0.8, 0.8, 1.0 };
^
語法錯誤:無效的語法
爲下面的代碼,我知道我需要進口一些使用GLfloat,可你什麼一個告訴我,我需要做什麼來導入在Python中這樣做。
GLfloat mat_specular[] = { 0.8, 0.8, 0.8, 1.0 };
GLfloat mat_shininess[] = { 32.0 };
GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST)
這不是python;它是C或C++ – 2010-11-02 17:53:39