PDA

View Full Version : Draping texture for geometry drawn using GL_TRIANGLE_STRIP



vinothrajendran4
02-24-2017, 12:52 AM
Hi Community,
I am drawing 4 sides of a building using GL_TRIANGLE_STRIP.... I would like to know how to drape a same 2D Texture image on all 4 sides of the building....

Any help is appreciated ....

paul_g_griffiths
02-25-2017, 02:24 PM
If it's a model from a modeling application such as blender or 3d studio max then loaded with a model library like ASSIMP then read or watch a tutorial about texture mapping.

If it's a model you have programmed with code then simply use the same texture and texture coordinates for each side.

Silence
02-26-2017, 08:01 AM
Hi Community,
I am drawing 4 sides of a building using GL_TRIANGLE_STRIP.... I would like to know how to drape a same 2D Texture image on all 4 sides of the building....

Any help is appreciated ....

Well, you have two options.

The first one (preferable one), get rid of triangle strips. And you'll be able to use one texture per face, easily.

The second one, arrange all your image in a single one so that it will fit your triangle strip. This is more complicated, more annoying and cannot be reused, however.