Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void drawMesh(StaticMesh* mesh, float scale)
- {
- glBindBuffer(GL_ARRAY_BUFFER, Buffers[mesh->bufferID]);
- glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0));
- model_view = glm::scale(model_view, glm::vec3(scale, scale, scale));
- glUniformMatrix4fv(location, 1, GL_FALSE, &model_view[0][0]);
- for (int i = 0; i < mesh->faceCount; i++)
- {
- GLuint face[3];
- face[0] = mesh->faces[i*3];
- face[1] = mesh->faces[i*3+1];
- face[2] = mesh->faces[i*3+2];
- glDrawElements(GL_LINE_LOOP, 3, GL_UNSIGNED_INT, face);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement