void drawFloor() { // enable texturing glEnable(GLTEXTURE2D); // bind the texture…
Jump to turn (8)
- User
void drawFloor() { // enable texturing glEnable(GL_TEXTURE_2D); // bind the texture glBindTexture(GL_TEXTURE_2D, BoxList2);
code// grass glPushMatrix(); glTranslatef(-2.5f, -0.1f, -2.5f); glScalef(6.0f, 0.2f, 6.0f); glutSolidCube(1.0f); glPopMatrix(); // disable texturing glDisable(GL_TEXTURE_2D);} make it in the shape of an island
- Assistant
void drawFloor() { // enable texturing glEnable(GL_TEXTURE_2D); // bind the texture glBindTexture(GL_TEXTURE_2D, BoxList2);
code// sand surrounding the grass island glPushMatrix(); glTranslatef(0.0f, -0.1f, 0.0f); glScalef(8.0f, 0.2f, 8.0f); glutSolidCube(1.0f); glPopMatrix(); // grass island glPushMatrix(); glTranslatef(0.0f, -0.05f, 0.0f); // slightly raise the island above the sand glScalef(4.0f, 0.2f, 4.0f); glutSolidCube(1.0f); glPopMatrix(); // disable texturing glDisable(GL_TEXTURE_2D);