View Full Version : Texturing Quads
08-19-2001, 05:33 AM
i have a strange problem while using
quads, if i have a quad with 2
vertices very close to each other then
the texture is applied as if it were a
triangle rather than the texture being
progressivly narrower as it gets towards the
hope you can understand this
08-19-2001, 05:53 AM
This sounds like normal behavior to me. See, if you stretch (or squeeze) the texture along one edge but not the other, the hardware will interpolate the texture of each triangle of the quad differently. To compensate for that difference you need to use the q coordinate of the texture coordinate so that each triangle's texture will be interpolated in a consistent manner.
There is a link to a site somewhere that descibes this in good detail and shows how to calculate q in this instance. I'll post that link if I find it.
[This message has been edited by DFrey (edited 08-19-2001).]
08-19-2001, 06:00 AM
08-19-2001, 11:23 PM
looks like its what i want.
Is'nt this another example of prefering triangles above other polygons?
08-20-2001, 10:20 AM
No it is not an example of why triangles should be preferred, the exact same problem would appear with individual triangles. After all, the quad is triangulated automatically into either a triangle fan or strip.
08-20-2001, 01:04 PM
Holy crap this q thing actually works ... for the most part.
All is fine while the top two verticies are apart. However when the verticies close to the point where my quad becomes a triangle I see just a zoomed bit of the lower left of my texture covering the entire triange and not a squeezed texture. What should I set q to now?
08-20-2001, 02:30 PM
You can't squeeze it too much because eventually the floating point errors start to become significant. I'm not sure what you can do at that point.
08-22-2001, 11:17 PM
ive found a work around, all my quads are
subdivided (in order to apply dicplacement
maps and greater lighting quality from
patched lights (both of these are to do
this week)) and if you do this to a level
of one or more the problem is drastically reduced.
08-23-2001, 07:53 AM
hi, it could be a graphics failure of the inner angle of the cam!
if objects are far away of your cam this effect will be if your inner angle of cam is to slow!
so you have to make it bigger (like 1.0f)
in gluLookAt() function!
this is the variable in front of the view-distance! (the outer angle of cam)
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.