PDA

View Full Version : texture mapping from BMP



tsk
03-29-2003, 01:18 AM
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?

Mihail121
03-29-2003, 07:58 AM
You don't have to cut anything.You just set up a right texcoords

HalcyonBlaze
03-29-2003, 09:09 AM
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