View Full Version : Problem with texture mapping

11-19-2010, 07:16 AM
I am new in this forum but i little know and work with opengl.
My question is , in order to do texture mapping we actually try to fit the image in a square box. But if the image is not entirely covered with the box for example if the image is a plane and it is concave , when i try to fit the image in a box many area will remain with the background color (as the object of the image is concave) which is not at all required in my aero fighter game . Because in my game the background color changes with every stage i enter.

So, what should i do so that the empty area of the image should not show but only the object of the image will show??

Plz help me..

11-19-2010, 07:47 AM
You mean : make the background part transparent ?
You have to add an alpha channel to your textures : 0 in for the background, 255 for the plane.

11-19-2010, 11:30 PM
Sorry i can not explain it properly.
Plz Look at the picture below

(1,0) (1,1)
| _/ \_ |
| | | |
| |____| |

The square will be the box and the image of the house i want to add. I don't want to show the outside of the house(image)(vacent area enclosed by square). What should i do for this?

11-20-2010, 04:57 AM
You should add transparent values out of the house image. Image formats like jpg and bmp don't support transparency, you can try with tga or png.

11-20-2010, 10:38 PM
thanks. I will try.

11-21-2010, 04:37 AM
plz give me some suggestions to do it or any link so that i can do it.