Homework 8: Texture Mapping
Due: Tuesday, Nov. 22, 11:59pm on Moodle
For this assignment there is no pair programming. You are welcome to work together, but everyone should turn in their own code that they have written and understood.
Requirements:
Part 2: Textured Scene
In the next part we will create a fixed "room" or "scene" around our octahedron. First make
a "floor" similar to the one shown below (octahedron not shown). You may need some transformations to move the floor to the correct spot. Then make the "walls" or "background". Finally, you could create a "ceiling" or "sky" (not shown).
Requirements:
Repeating Textures
For a large region, usually we want to "tile" the texture instead of using one scaled image. To do this, we can set the repeat number of the texture in each direction (u and v). An example is shown below:
var texture = THREE.ImageUtils.loadTexture( 'mytexture.jpg' ); texture.wrapS = THREE.RepeatWrapping; texture.wrapT = THREE.RepeatWrapping; texture.repeat.set( 2, 3 ); // twice in u and three times in v
There is one major caveat to this: the dimensions of the texture image must be powers of 2 (16x16, 32x32, ... 256x256, etc). Make sure to crop your image so that the pixel dimensions will work in WebGL.
Submit your html file, a representative screenshot of your scene, and your texture(s).