0

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.

1
  • this question is far too broad to be answered here Commented Jun 18, 2011 at 16:14

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

libwave is really old and nearly impossible to get compiling

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.