Add texture to a 3d object (a road)

Hi,

I m trying to add a texture (ground.png) to a 3d object (strada.obj).
I tried follow some tutorials in this forum but I didn’t find a way to do with this object :frowning:

I don’t post the code because it’s probably completely wrong.

How can I do that?

Thanks you all.

-Giulio

Don’t know what you expect but nobody will write you the code or an tutorial that is made for your specific problem. It’s not even clear how you want to do that. Do you want to write an OpenGL app that loads the object, applies the texture and then renders it or do you just want to generate a new file that contains your combined object? In the latter case I think you are wrong here. You should find a tool that allows the modification of 3d objects. If you want to write an application that renders this object, my advice would be (assuming you have no real OpenGL experience):

  • Learn to set up a render context
  • Learn to write and compile shaders in your program
  • Render your first triangle
  • Find and learn to use a lib that loads textures into your program
  • Render your triangle with that texture
  • Find and learn to use a lib that loads 3d object files
  • Now you should know nearly everything to do the trick, since applying a texture to a mesh is quiet simple.

Tutorials for all the stuff I mentioned are found easily in the web. If you have specific problems with one of the substeps, just ask.

Greetings