PDA

View Full Version : Automatic Texture coord generation



Brian Jones
01-26-2003, 08:31 AM
I'm writing a texture manager, and one of the features will be automatic texture coord generation of 2d textures.

To generate the x and y coords for the object the texture will be applied it's

int x[4] = {1/widthofobj, 0, 0, 1};
int y[4] = {0, 1/heightofobj, 0, 0, 1};

for the x and y plane, respectively, right?

And also, the texture matrix stack must be transformed or translated -0.5 on x and y axis right? Everytime, right?

Tokage
01-26-2003, 04:11 PM
Wow, I've been beating myself up for days trying to figure out how to do what you're trying to do, and I tried what you said and yes, everything you mentioned is exactly correct. Thank you!