Question

Hey Guys, I'm 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?

thanks!

Was it helpful?

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

OTHER TIPS

If your models are much more complex than cubes, you use a UV map to translate the 3-dimensional surface of your model into a flat image for texture mapping.

Looks like this thread on gamedev has an example of how to extract what 3DS calls "texels" as well as materials.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top