PDA

View Full Version : texquad


shai
02-23-2005, 12:57 PM
hi, i was wondering, i'd like to use texquad to texture an image,
but for some reason it "scales" my image and makes my edges
fuzzy, but i'd like my edges to be as clean as they are in photoshop. is there a way to make texquad not scale my image?

tex = viz.add('images/stripes7.jpg')
quad2 = viz.add(viz.TEXQUAD)
quad2.translate(0,0.66,16)
quad2.texture(tex)

btw, even if i don't use .scale it still fuzzes the image, i also tried making the image into a perfect square but that doesn't help either, any suggestions?

thanks,
shai

farshizzo
02-23-2005, 01:09 PM
OpenGL texture dimensions must be a power of two, unless you use texture rectangles. To remove the fuzziness around the edges try the following:tex.wrap(viz.WRAP_S,viz.CLAMP_TO_EDGE)
tex.wrap(viz.WRAP_T,viz.CLAMP_TO_EDGE)If you don't want your texture to be scaled and you also don't want to resize it to a power of two then you can do the following:tex = viz.add('images/stripes7.jpg',viz.TEX_RECT)
xform = viz.Transform()
xform.setScale(width,height)
quad2.texmat(xform)Replace the variable width and height with the actual width and height of the image.