texture mapping from BMP

I have loaded a bitmap file into the openGL and I need to cut a triangle part to done the texture mapping to a triangle, can anybody tell me how can I do?

You don’t have to cut anything.You just set up a right texcoords

You want to do this:

  ------* (1,1)
  |    **
  |   * *
  |  *  *
  | *   *
  |*    *

(0,0) ******* (1,0)

The shape made out of ‘-’ and ‘|’'s is what you need to make your triangle a square. So if you texture it like you would a sqare, or a rectangle, you’ll get a triangle texture. Because that other chunk on th left doesn’t exist.

Look at the tutorial by nehe on loading textures as resources and texturing triangles. It’s tutorial 34 or something.

  • Halcyon