TextureMapping

 

What is it?


Texture mapping is a technique for adding detail to an object through the use of a texture map (image file) in which coordinates on the image are mapped to a coordinate on the image file (a.k.a 2D Texture Mapping).

The Basics


Texture Mapping involves the use of a 2D coordinate, often called uv, which are associated to a texture map (image file). The key is then to associate 3D points on a object to the 2D uv coordinate system. It is crucial to that the coordinates on the image and the object match in right way to get the desire mapping effect.


The bonus to texture mapping is that once the uv coordinate for an object is found, normally that same uv coordinate can be mapped to several other types of maps, such as bump maps, displacement maps, opacity maps etc...


In this raytracing assignment, I implemented the calculations to appropriately texture map the basic primitives (cube, sphere, cylinder and torus).