Advertisement
BZWGolem

BunnyTextures

May 30th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. class Bunny{
  2.     GLuint textures[100];
  3.  
  4.     void Bunny::draw(int frame)
  5.     {
  6.         glPushMatrix();
  7.             glEnable(GL_TEXTURE_2D);
  8.    
  9.             // rysowanie tułowia (spłaszczone koło)
  10.             glPushMatrix();
  11.                 GLUquadric* thorax = gluNewQuadric();
  12.                 gluQuadricNormals(thorax, GLU_SMOOTH);
  13.                 gluQuadricTexture(thorax, GL_TRUE);
  14.                 glBindTexture(GL_TEXTURE_2D, textures[1]);
  15.                 glTranslatef(0, -2, 0);
  16.                 glScalef(1, 0.7, 0.7);
  17.                 gluSphere(thorax, 1.5, 36, 36);
  18.             glPopMatrix();
  19.             glDisable(GL_TEXTURE_2D);
  20.         glPopMatrix();
  21.     }
  22.  
  23.     void Bunny::loadTextures()
  24.     {
  25.         textures[1] = ilutGLLoadImage((wchar_t*)"textures/fursmall.jpg");
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement