Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Texture Mapping

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2012
    Posts
    9

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

  2. #2
    Junior Member Newbie
    Join Date
    Feb 2006
    Location
    Downey, CA
    Posts
    20
    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.
    Visit Lazy Foo' Productions home of my SDL tutorials

    Want to transition from OpenGL 2.1 to 3.0+? Check out my OpenGL Tutorial

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2012
    Posts
    9
    hey i need to texture on the 3d object i imported from 3ds max... i use(.obj) file....please help me in this case!!!

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,135
    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.

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2006
    Location
    Downey, CA
    Posts
    20
    Quote Originally Posted by thokra View Post
    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.
    Visit Lazy Foo' Productions home of my SDL tutorials

    Want to transition from OpenGL 2.1 to 3.0+? Check out my OpenGL Tutorial

  6. #6
    Junior Member Newbie
    Join Date
    Aug 2012
    Posts
    9
    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??

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,135
    Quote Originally Posted by Lazy Foo'
    I also provide a OpenGL 3.0+ texture mapping 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 ...

    Quote Originally Posted by Abd_jml
    i need to map a particular texture to a particular spot!! !!
    Yes, we get your problem. Stop using excessive exclamation marks!!!!!!!!!!!!! See? Isn't that annoying?

    Quote Originally Posted by Abd_jml
    which image file would i used?? tga or jpeg??!!
    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?

  8. #8
    Junior Member Newbie
    Join Date
    Aug 2012
    Posts
    9
    im following this link http://www.3dcodingtutorial.com/Text...-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

  9. #9
    Junior Member Newbie
    Join Date
    Feb 2006
    Location
    Downey, CA
    Posts
    20
    Quote Originally Posted by thokra View Post
    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.
    Visit Lazy Foo' Productions home of my SDL tutorials

    Want to transition from OpenGL 2.1 to 3.0+? Check out my OpenGL Tutorial

  10. #10
    Junior Member Newbie
    Join Date
    Aug 2012
    Posts
    9
    hey can u help me ? i didn't find any god stuff that help me :/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •