dodanie modelu lazik3.obj

This commit is contained in:
2024-11-27 13:56:33 +01:00
parent 8a9d42c793
commit 74256cf14b
4 changed files with 7690 additions and 7 deletions

View File

@@ -263,7 +263,7 @@ void RenderScene(void) {
/* */
// Read our .obj file
bool res = loadOBJ("suzanne.obj", vertices, uvs, normals);
bool res = loadOBJ("lazik3.obj", vertices, uvs, normals);
/* */
glGenBuffers(1, &vertexbuffer);
@@ -329,10 +329,10 @@ void RenderScene(void) {
//glUseProgram(programID);
// Bind our texture in Texture Unit 0
//glActiveTexture(GL_TEXTURE0);
//glBindTexture(GL_TEXTURE_2D, Texture);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, Texture);
// Set our "myTextureSampler" sampler to use Texture Unit 0
//glUniform1i(TextureID, 0);
glUniform1i(TextureID, 0);
// 1rst attribute buffer : vertices
glEnableVertexAttribArray(0);
@@ -346,7 +346,7 @@ void RenderScene(void) {
(void*)0 // array buffer offset
);
// 2nd attribute buffer : UVs
// 2nd attribute buffer: UVs
glEnableVertexAttribArray(1);
glBindBuffer(GL_ARRAY_BUFFER, uvbuffer);
glVertexAttribPointer(
@@ -358,7 +358,7 @@ void RenderScene(void) {
(void*)0 // array buffer offset
);
// Draw the triangle !
// Draw the triangle!
glDrawArrays(GL_TRIANGLES, 0, vertices.size() );
glDisableVertexAttribArray(0);
@@ -706,6 +706,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
case ' ': // 32
polygonmode = !polygonmode;
if (polygonmode) std::cout << "debug: tryb wireframe jest niewydajny i powinien sluzyc tylko do debugowania!\n";
break;
default: