Created
May 12, 2019 00:18
-
-
Save Thassoun999/34cde14df901cc4ae0c253a0e7ee573d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | |
| /*--- Set up and pass on Projection matrix to the shader ---*/ | |
| mat4 p = Perspective(fovy, aspect, zNear, zFar); | |
| /*----- Set up the Mode-View matrix for the floor and axis -----*/ | |
| mat4 mv = LookAt(c_eye, c_at, up); | |
| glUseProgram(program); | |
| model_view = glGetUniformLocation(program2, "model_view"); | |
| projection = glGetUniformLocation(program2, "projection"); | |
| glUniformMatrix4fv(model_view, 1, GL_TRUE, mv); // GL_TRUE: matrix is row-major | |
| glUniformMatrix4fv(projection, 1, GL_TRUE, p); // GL_TRUE: matrix is row-major | |
| glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); | |
| drawObj(floor_buffer, floor_NumVertices); // draw the floor | |
| glutSwapBuffers(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment