Gltexturewrapt glrepeat

This preview shows page 38 - 41 out of 41 pages.

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexImage2D(GL_TEXTURE_2D, GL_RGB, width, height, 0, GL_RGB, GL_INT, texImage); }
Image of page 38

Subscribe to view the full document.

Example of Using Textures (2)  void display (void) { glEnable(GL_TEXTURE_2D); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); glBindTexture(GL_TEXTURE_2D, texName); DrawQuad(); glFlush(); glDisable (GL_TEXTURE_2D); }
Image of page 39
Example of Using Textures  (3) void DrawQuad(void) { glBegin(GL_QUADS); glTexCoord2f (0.0, 0.0); glVertex3f (-2.0, -1.0, 0.0); glTexCoord2f (0.0, 1.0); glVertex3f (-2.0, 1.0, 0.0); glTexCoord2f (1.0, 1.0); glVertex3f (0.0, 1.0, 0.0); glTexCoord2f (1.0, 0.0); glVertex3f (0.0, -1.0, 0.0); glTexCoord2f (0.0, 0.0); glVertex3f (1.0, -1.0, 0.0); glTexCoord2f (0.0, 1.0); glVertex3f (1.0, 1.0, 0.0); glTexCoord2f (1.0, 1.0); glVertex3f (2.414, 1.0, -1.4.1); glTexCoord2f (1.0, 0.0); glVertex3f (-2.4.1, -1.0, -1.414); glEnd(); }
Image of page 40

Subscribe to view the full document.

Animation   • Use double-buffer mode. • Render to one buffer, then to the other, swapping each time. void display ( void ) { glClear (GL_COLOR_BUFFER_BIT); // draw objects here glutSwapBuffers(); } int main () { glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB); }
Image of page 41
You've reached the end of this preview.
  • Spring '08
  • Jones,M
  • Light, Pointer, Diffuse reflection, current matrix

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern