Hey guys, I’m a beginner at Opengl, and would appreciate some help regarding the following problem.
I have loaded a 3D model of a bowl(the sort you use for cereal), into opengl from an obj file which contains the vertices, normals, faces etc.
I have used glBegin(GL_LINES) to connect the vertices to one another, and therefore I have a model which appears like a wireframe.
I need to colour the model and then implement phong shading.
I know its easy to colour the model by just adding the the following code before glBegin
and then changing GL_LINES to GL_TRIANGLES. However I need to do this without using GL_TRIANGLES. I need to colour each pixel within the faces some other way. I am able to colour the vertices through which the lines are connected, but i need to colour the entire area/face enclosed by the lines.
Any idea how this can be done?
any advice will be highly appreciated.