Search code examples
opengltexturestexture-mapping

How to texture map a JPG image referenced in an MTL file of an object using OpenGL?


How do I do that? I'm currently using Nate Robin's GLM but I don't think it supports this kind fo texturing?


Solution

  • I've looked at GLM's source. It seems there is no direct support of texture loading (even texture binding). But, texture coordinates are usable. So, you have to manually handle texture loading and binding. As a beginning, I recommend to use some raw images (you can directly load into a array). Later you can pick up a proper library. If size matters, NanoJPEG can be a wise choice.

    For learning how to apply textures, here is a tutorial from defacto OpenGL tutorial series.