Texture Mapping

Texture mapping is a technique to map some patterns to a surface. A 2D texture map is a pattern that is pasted onto a surface. A 3D texture map defines a color at each 3D coordinate (x,y,z). A 3D texture is also called a solid texture. When a 3D texture is mapped onto a 3D geometry, it is as though a 3D geometry has been carved out of a specific material.A texture pattern can be either defined by a function or by some 2D or 3D data.

This application demonstrates an implementation of 2D & 3D texture mapping. The chosen patterns are bitmap images, and a generated cloud surface from Perlin-Noise algorithm. Perlin-Noise algorithm suggests an approach to generate interesting 3D textures. The algorithm uses noise and turbulence functions. The noise function is a continuous function that varies in 3D space at uniform frequency. The turbulence functions is obtained by mixing several noise functions together.

How do I get set up?

  • This program is written in C++ and OpenGL. Make sure you have OpenGL library installed.
  • Compilation process
    • Windows: compile and run in IDE
    • Mac:
      g++ -Wall -o yourfile yourfile.cpp -framework OpenGL - framework GLUT
    • Linux:
      g++ -g -o yourfile -I/usr/include/GL yourfile.cpp -lGL -lglut -lm -lGLU

Viet Trinh © 2013

alt tag