Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: A picture in a wall, without create a new object

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2001
    Location
    spain
    Posts
    3

    A picture in a wall, without create a new object

    Hello. I need to know if there is a function that allow me to put an image in a face of an object, but not as a texture. I want to put an image with dimensions that arenīt power of 2 in a face of an object, like a picture in a wall. So, I need a fuction that paste this image in the object as a bitmap, not as a texture. Anybody can help me?
    Thank you.

  2. #2
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: A picture in a wall, without create a new object

    it is using a texture but its the obvious example
    glTexSubImage2D(..)
    no need to be powers of 2

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2001
    Location
    spain
    Posts
    3

    Re: A picture in a wall, without create a new object

    I knew the function glTexSubImage2D(..), but this isnīt what I need, because it only can paste an image replacing a part of a texture, but in the range of the originally defined texture array. My problem is that I take a small array of texture and I repeat this texture for cover all the face of an object. Then, when I have cover all the face repeating the texture, I need to paste an image in a determined place of the face. With glTexSubImage2D(..), I can paste this image in the original small array of texture. Then, when I repeat this texture, the image is repeating too.
    Thank you, in any case.

  4. #4
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: A picture in a wall, without create a new object

    use 2 images one for the wall and the other for the picture position the picture in front of the wall or u could position it at the same z distance but make sure u use eg glDepthFunc(GL_LEQUAL).
    make the parts of the pictures textures u dont wanna see have zero alpha values and enable alpha testing

Posting Permissions

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