PDA

View Full Version : QUAD_STRIP with a texture



Robin Forster
12-19-2001, 12:32 PM
Is it possible to render a QUAD_STRIP or TRI_STRIP with a bound texture? I haven't seen any sample code that does this.

Rob The Bloke
12-20-2001, 02:29 AM
Its exactly the same as texturing a quad or triangle

endo
12-20-2001, 04:29 AM
I was curious about this also. It must be different from a triangle or quad because a single vertex can be a point on more than one quad in a strip. This complicates the issue of texture coordinates.

I think it is down to the texture parameters used ie clamping, wrapping, whatever - but I haven't been able to do it either yet

Any chance of a small sample of code from someone?

Rob The Bloke
12-21-2001, 03:12 AM
Originally posted by endo:
I was curious about this also. It must be different from a triangle or quad because a single vertex can be a point on more than one quad in a strip. This complicates the issue of texture coordinates.


nope it doesn't - strips must share vertices, tex-coords and normals. If you have geometry that doesn't share the data then use seperate strips.

It is exactly the same as texturing a quad or triangle!!!!

Marc
12-21-2001, 09:11 AM
Originally posted by Rob The Bloke:
nope it doesn't - strips must share vertices, tex-coords and normals. If you have geometry that doesn't share the data then use seperate strips.

It is exactly the same as texturing a quad or triangle!!!!



This is the reason, why you can't build a cube with normals from quad-strips.

Robin Forster
12-21-2001, 04:16 PM
I managed to do it with a single bound texture. It would nice if you could change textures though. I don't see this as possible unless perhaps if I used a texture strip and specified different texture coordinates for each iteration.

Bob
12-22-2001, 02:49 AM
This is the reason, why you can't build a cube with normals from quad-strips.

A vertex is not only three (or four to be correct, OpenGL uses homogenous cooridnates) coordinates. It has color, texture coordinate, normal componentes, fog factor, and so on, associated to it aswell. If one or more of these componenets change, you no longer have the same vertex. So if two vertices with he same coordinates has different normals, they can not be merged into one, because they are not the equal.