Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Thassoun999/34cde14df901cc4ae0c253a0e7ee573d to your computer and use it in GitHub Desktop.

Select an option

Save Thassoun999/34cde14df901cc4ae0c253a0e7ee573d to your computer and use it in GitHub Desktop.
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