PDA

View Full Version : how to map texture without changing size



dora
04-20-2005, 07:30 PM
I want to map a texture with size of 64*64 to a mesh with size of 1024*1024. But I dont know how to do that without changing the resolution of the texture.
That is to say, how to map the whole texture to the mesh from (0,0) to (64,64) and at the same time, the resolution of the texture will not be changed.

thanks a lot

CWiC
04-20-2005, 09:14 PM
You must use texture coordinates in terms of (0,1) not (0,64) or (0,1024). Maybe you can explain better what you want to achive? What is the mesh of 1024x1024? Can't even imagine what you asking about...

zero_t9
04-20-2005, 09:16 PM
Are you programming or using some existing software?

glTexParameteri( , GL_TEXTURE_WRAP_S / GL_TEXTURE_WRAP_T, )?


Originally posted by dora:
I want to map a texture with size of 64*64 to a mesh with size of 1024*1024. But I dont know how to do that without changing the resolution of the texture.
That is to say, how to map the whole texture to the mesh from (0,0) to (64,64) and at the same time, the resolution of the texture will not be changed.

thanks a lot

dora
04-20-2005, 09:47 PM
maybe i dont describe the problem so clearly.

in fact, i want to map a smaller texture to a terrain mesh repeatly.

I use the code:
glTexImage2D(GL_TEXTURE_2D, 0, 3, 64, 64, 0, GL_RGB, GL_UNSIGNED_BYTE, gTexture.data);

but the result is not the same as i expect.

Bob
04-20-2005, 11:45 PM
You're right you didn't specify the problem clearly, and you still haven't. We still don't know what you do, how you do it, what you get and what you expect to get. Give us a detailed explanation of all the four unknown details I mentioned.

We can't tell you, nor guess, what's wrong. YOU have to tell US what's wrong, and we can (hopefully) help you fix it.

Overmind
04-20-2005, 11:59 PM
Try to set glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S/T, GL_REPEAT) to repeat the texture and use texture coordinates (0,0) to (16,16) to place 16 copies of the texture on the terrain (64*16 = 1024)...