How can I scale a mesh without scaling it's texture? Thanks.

Started by
5 comments, last by danromeo 20 years, 8 months ago
How can I scale a mesh without scaling it''s texture? Thanks.
Advertisement
what does that even mean?

If you have a textured mesh of a character and you make the character twice as big, what do you want the texture to look like?
You can''t without editting the mesh''s texture (u,v) co-ordinates.
Set a texture transform to scale the opposite of the mesh scale should do the trick.

You''ll need to program the transform matrix, and set the texturetransformflags to D3DTTF_COUNT2.
I''m trying to scale a brick wall on the y axis and have it still look like a brick wall after the scale, so I want to leave the texture as-is, but have it wrap across the entire scaled wall.

TEXTURE TRANSFORM- I''m sorry, but can you give me some hint as to how to do this, since the people who wrote the MS docs have chosen not too? Or even just tell me where to find info in the MS docs, if you could.

THANKS FOR THE HELP.
clone the mesh, then edit the tu and tv coords to however many times you want to tile the texture, its best to have a seperate class to calculate them and make the number of tiles a function of the world space area.

if you are literally doing a brick wall it would be simpler to just write the code to build the wall via vertices so that you have first authoring control of their tu and tv''s.
"Let Us Now Try Liberty"-- Frederick Bastiat
The device->SetTransform() function can also be passed a texture stage as well as world, view and projection matrices. It''s in the DX docs.

This topic is closed to new replies.

Advertisement