Search code examples
opengltexture-mapping

OpenGL - texturing mapping 3D object


I have model of skull loaded from .obj file based on this tutorial . As long as I understand texture mapping of cube (make triangle on texture in range of [0,1], select one of six side, select triangle of two triangles on this side and map it with your triangle from texture), I have problem with thinking for any solution to texture mapping my skull. There are few thousands of triangles on it and I think that texture mapping them manually is more than wrong.

Is there any solution for this problem? I'll appreciate any piece of code since it may tell me more than just description of solution.


Solution

  • You can generate your UV coordinates automatically, but this will probably produce badly looking ouput except for very simple textures. For detailed textures that have eyes, ears, etc., you need to crate your UV coordinates by hand in some 3d modeling tool like is Blender 3d, 3DS Max etc... There is a lot of tutorials all over the internet how to do that. (https://www.youtube.com/watch?v=eCGGe4jLo3M)