View Full Version : Texturing Quads
08-19-2001, 06: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, 06: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, 07:00 AM
08-20-2001, 12:23 AM
looks like its what i want.
Is'nt this another example of prefering triangles above other polygons?
08-20-2001, 11: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, 02: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, 03: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-23-2001, 12:17 AM
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, 08: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.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.