I have these files: sample.obj, sample.mtl and a folder sample containing image jpg. Can somebody give me an example code of opengl texture mapping using above input.
Asked
Active
Viewed 3,279 times
1 Answers
1
Your problem is not just texture mapping. What you are asking for is loading an Wavefront OBJ model and its material library, then passing this data to OpenGL rendering commands. Depending on how many preexisting code you want (not) to use this takes different amounts of code. However there's no such thing like a simple OpenGL function that does it all in a black box.
Although this is a FAQ and Google brings you some results I didn't find a tutorial that really explains what's going on.
If you want it to be really simple, use a Wavefront loader and render library: http://www.evl.uic.edu/pape/sw/libwave.html

datenwolf
- 159,371
- 13
- 185
- 298