Texture Mapping

hello everyone!!!
Can any please tell me how to do texture mapping in opengl…i imported the .obj file into opengl then i want to do texture mapping on it…can any one telll??? please??

To do OpenGL texture mapping all you have to do is send the pixels to a texture object and then map the texture coordinates to your polygons. OpenGL doesn’t have any file loading capabilities, so you’ll have to use an image loader like DevIL or what ever is built into your windowing API.

Oh and if you’re using GLSL to texture map (which you probably should be doing), all you have to do is call the GLSL texture function in your fragment shader.

hey i need to texture on the 3d object i imported from 3ds max… i use(.obj) file…please help me in this case!!!

You could have the most awesome 3D object in the world and it still wouldn’t help you in any way unless you understand the concept of vertex attributes, or more specifically texture coordinates. However, I would advise against using Lazy Foo’s tutorial, as it portrays the matter using legacy OpenGL. Use Alfonse’s tutorial instead.

I also provide a OpenGL 3.0+ texture mapping tutorial if you have a severe allergy to legacy code.

i need to map a particular texture to a particular spot!! !! which image file would i used?? tga or jpeg??!!
i don’t know how to export (.tga and .obj) simultaneously!!!from 3ds max…i just export the model in .obj file…can any one help me here??

It’s not about an allergy - it simply consistent to not advise to use legacy OpenGL. Anyone starting a new project and has at least Geforce 8000 series or Radeon HD 2000 series hardware at their disposal, should not give a damn about fixed-function stuff. If the ARB had only made deprecation and removal mandatory and not conceived GL_ARB_compatibility, we wouldn’t have this discussion …

Yes, we get your problem. Stop using excessive exclamation marks!!! See? Isn’t that annoying?

It doesn’t matter since you need another third party library to load the images anyway. OpenGL has no concept of image formats like JPEG.

i don’t know how to export (.tga and .obj) simultaneously!!!from 3ds max…i just export the model in .obj file…can any one help me here??

Do you have you model textured in 3ds max? If so, you must have imported your images from somewhere, unless they were generated in 3ds max directly. If not, than what images are you talking about?

im following this link http://www.3dcodingtutorial.com/Textures/Loading-Textures.html.
i imported the model in opengl now i have to do texture mapping on it.how can i do that.any example would be helpful?
sory for the exclamation mark

Actually, the original prototype for the tutorial used OpenGL 3.0 from the start, but in testing group only about 20% of the people were getting anything. Using the old fixed function pipeline to start made learning modern programmable pipeline much easier for the group to pick up modern OpenGL.

hey can u help me ? i didn’t find any god stuff that help me :confused:

I’m just guessing that you should be posting in the beginner forum; though I don’t know a whole lot about what goes on in there myself. I assume it looks a lot like this thread.