c++opengltexture-mapping3dsuv-mapping

OpenGL Texture Mapping


I am new to game programming and graphics programming. However, I eagerly wish to learn, so I have begun building a game engine with OpenGL. I have implemented all of the basic graphical features, and now I want to add texture support for my triangle meshes.

The only tutorials I can find for texture mapping is for a single polygon - how do I define a texture that wraps around the entire mesh?

I am loading the meshes from .3ds files using lib3ds (http://code.google.com/p/lib3ds/). Do .3ds file carry some texture coordinate data or something?


Solution

  • Here's a page showing an example of reading out the texture coordinates:

    http://newsgroups.derkeiler.com/Archive/Comp/comp.graphics.api.opengl/2005-07/msg00168.html

    However, not all 3ds files contain texture information - see warning in:

    http://www.groupsrv.com/computers/about186619.html