Skip to main content
gamedev.net
🔒 Locked

UV mapping coordinates problem

Started by glsensor Aug 16, 2006 at 1:09 AM 3 replies 850+ views
Original Post
glsensor
glsensor
I mapping a sub-texture to a mesh's surface that in the 3DSMAX8 seem as very well. Then I loaded box.x in scene and rendered. The sub-texture coordinates's position is wrong, and stretch, what problem is it?
Demus79
Demus79

Are you using uv-scale in the material ? Perhaps the x-file exporter doesn't take that in account ?

Just a guess though.
glsensor
glsensor
yes, I set material in code, but it seem didn't working so that texture coordinates are default Values.

for ( DWORD i = 0; i < numMaterials; i++ )
{
pDevice->SetMaterial( m_pMesh->GetMeshMaterial( i ) );
pDevice->SetTexture( 0, m_pMesh->GetMeshTexture( i ) );
}
Demus79
Demus79
What I meant was that,

- D3D materials don't contain texture transformations.
- In 3DSMAX, using uvw-scale/offset defines a transformation (matrix) to be used to the defined texture coordinates. AFAIK, the texture coordinates exported by the exporter don't contain these material texture coordinate transformations.

But at this point, I don't know if you used these uvw-scale things in your material, so it is just a guess.

Cheers
glsensor
glsensor
In 3DSMAX, I just selected two surfaces of the mesh and dragged a material(Mapping channel 2) on it only. Then I added UVW-Mapping and setted it to be channel 2.

Thank.

[Edited by - glsensor on August 18, 2006 9:09:10 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.