Guest User

Untitled

a guest
Jul 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. // Floor
  2. glEnable( GL_TEXTURE_2D );
  3. glBindTexture( GL_TEXTURE_2D, m_iFloorTextureID );
  4. glBegin( GL_QUADS );
  5. glNormal3f( 0.0f, 1.0f, 0.0f );
  6. glTexCoord2f( 0.0f, 0.0f );
  7. glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
  8. glTexCoord2f( 1.0f, 0.0f );
  9. glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
  10. glTexCoord2f( 1.0f, 1.0f );
  11. glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
  12. glTexCoord2f( 0.0f, 1.0f );
  13. glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
  14. glEnd();
  15. glDisable( GL_TEXTURE_2D );
  16.  
  17. // Ceiling
  18. glEnable( GL_TEXTURE_2D );
  19. glBindTexture( GL_TEXTURE_2D, m_iCeilingTextureID );
  20. glBegin( GL_QUADS );
  21. glNormal3f( 0.0f, -1.0f, 0.0f );
  22. glTexCoord2f( 0.0f, 0.0f );
  23. glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
  24. glTexCoord2f( 1.0f, 0.0f );
  25. glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
  26. glTexCoord2f( 1.0f, 1.0f );
  27. glVertex3f( MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
  28. glTexCoord2f( 0.0f, 1.0f );
  29. glVertex3f( MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
  30. glDisable( GL_TEXTURE_2D );
  31. glEnd();
  32. glDisable( GL_TEXTURE_2D );
  33.  
  34. // Front wall
  35. glEnable( GL_TEXTURE_2D );
  36. glBindTexture( GL_TEXTURE_2D, m_iWallTextureID );
  37. glBegin( GL_QUADS );
  38. glNormal3f( 0.0f, 0.0f, 1.0f );
  39. glTexCoord2f( 0.0f, 0.0f );
  40. glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
  41. glTexCoord2f( 1.0f, 0.0f );
  42. glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
  43. glTexCoord2f( 1.0f, 1.0f );
  44. glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
  45. glTexCoord2f( 0.0f, 1.0f );
  46. glVertex3f( MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
  47.  
  48. // Back wall
  49. glNormal3f( 0.0f, 0.0f, -1.0f );
  50. glTexCoord2f( 0.0f, 0.0f );
  51. glVertex3f( MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
  52. glTexCoord2f( 1.0f, 0.0f );
  53. glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
  54. glTexCoord2f( 1.0f, 1.0f );
  55. glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
  56. glTexCoord2f( 0.0f, 1.0f );
  57. glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
  58.  
  59. // Left wall
  60. glNormal3f( 1.0f, 0.0f, 0.0f );
  61. glTexCoord2f( 0.0f, 0.0f );
  62. glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
  63. glTexCoord2f( 1.0f, 0.0f );
  64. glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
  65. glTexCoord2f( 1.0f, 1.0f );
  66. glVertex3f( -MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
  67. glTexCoord2f( 0.0f, 1.0f );
  68. glVertex3f( -MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
  69.  
  70. // Right wall
  71. glNormal3f( -1.0f, 0.0f, 0.0f );
  72. glTexCoord2f( 0.0f, 0.0f );
  73. glVertex3f( MAP_BOUNDS, MAP_BOUNDS, -MAP_BOUNDS );
  74. glTexCoord2f( 1.0f, 0.0f );
  75. glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, -MAP_BOUNDS );
  76. glTexCoord2f( 1.0f, 1.0f );
  77. glVertex3f( MAP_BOUNDS, -MAP_BOUNDS, MAP_BOUNDS );
  78. glTexCoord2f( 0.0f, 1.0f );
  79. glVertex3f( MAP_BOUNDS, MAP_BOUNDS, MAP_BOUNDS );
  80. glDisable( GL_TEXTURE_2D );
  81. glEnd();
  82. glDisable( GL_TEXTURE_2D );
Add Comment
Please, Sign In to add comment