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??

Lazy Foo'

09-02-2012, 08:50 PM

To do OpenGL texture mapping (http://lazyfoo.net/tutorials/OpenGL/05_texture_mapping_and_pixel_manipulation/index.php) 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 (http://lazyfoo.net/tutorials/OpenGL/34_glsl_texturing/index.php).

Abd_jml

09-03-2012, 02:07 PM

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

thokra

09-03-2012, 11:49 PM

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 (http://www.arcsynthesis.org/gltut/).

Lazy Foo'

09-04-2012, 01:32 AM

However, I would advise against using Lazy Foo's tutorial, as it portrays the matter using legacy OpenGL. Use Alfonse's tutorial instead (http://www.arcsynthesis.org/gltut/).

I also provide a OpenGL 3.0+ texture mapping (http://lazyfoo.net/tutorials/OpenGL/34_glsl_texturing/index.php) tutorial if you have a severe allergy to legacy code.

Abd_jml

09-04-2012, 03:22 AM

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??

thokra

09-04-2012, 07:07 AM

I also provide a OpenGL 3.0+ texture mapping (http://lazyfoo.net/tutorials/OpenGL/34_glsl_texturing/index.php) tutorial if you have a severe allergy to legacy code.

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 ...

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?

Abd_jml

09-04-2012, 01:31 PM

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

Lazy Foo'

09-04-2012, 09:52 PM

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 ...

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.

Abd_jml

09-05-2012, 04:40 AM

hey can u help me ? i didn't find any god stuff that help me :/

michagl

09-08-2012, 12:54 PM

hey can u help me ? i didn't find any god stuff that help me :/

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.