PDA

View Full Version : Mappig Textures to Polygons



Humble_1
02-13-2003, 10:27 AM
I think I might just be having a brain hiccup. Here痴 my question:

I知 writing a 3D application and I知 trying to figure out how to choose the ideal pixel size of a bitmap to use for level 0 mip mapping. The problem is that I知 not exactly sure how to match the size of a texture to fit the size of a polygon. I want to be able to do a close zoom up of the textured polygon, with minimal blur.

Is it as simple as a 256x256 "unit" polygon requires a 256x256 pixel bitmap?

Thanks.

zen
02-13-2003, 03:21 PM
I think it actually is :polygons that get rasterized to 256x256 pixels need a 256x256 texture(as you might have expected).I mean that texture minification/magnification depends on the final(2d rasterized) size of the polygon wich in turn depends on your resolution,modelview and projection matrices etc.The best I can think of is that using an apropriate ortho projection (like glOrtho(0, 640, 0, 480, -1, 1) for a 640x480 window) you can map gl units to screen pixels and do what you propose.

[edit]:damn smilies

[This message has been edited by zen (edited 02-13-2003).]

Humble_1
02-14-2003, 08:46 AM
Zen,

I really appreciate you taking the time to consider my question, and I agree with your answer.

Thanks!