Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have created my map for my game using 3DS Max. I have then applied textures to the map within 3DS Max, where the textures all show correctly. I export the map as a .fbx file to use within an XNA project.

However as you can see from the below screenshot, the textures are not displayed correctly in XNA.

Example screenshot

Does anyone know why this is happening?

I am using the Autodesk FBX content importer and the Model - XNA Framework Content Processor.

As you can see my model which was created in the same way has the textures displayed correctly, it is only doing it to my map.

share|improve this question
    
Please elaborate on how they are incorrect. Perhaps a side-by-side of the XNA project and 3dSmax. –  Seth Battin Apr 18 '13 at 17:38
2  
Looks like your texture sampler state is set to clamp, not wrap. How are you drawing the model? –  dadoo Games Apr 18 '13 at 17:41
    
@SethBattin The textures are supposed to be like the square but all the way along the walls, not being stretched out. Here is a picture from within 3DS Max i.imgur.com/HhrvfwE.jpg –  RonnieB555 Apr 18 '13 at 18:41
    
@dadooGames I am loading my map model in with this, myMap = Content.Load<Model>("Assets/map_2013D"); Then drawing it with this, foreach (ModelMesh mesh in myMap.Meshes) { foreach (BasicEffect effect in mesh.Effects) { effect.EnableDefaultLighting(); effect.World = Matrix.CreateTranslation(mapPosition); effect.View = camera.view; effect.Projection = camera.projection; } mesh.Draw(); } –  RonnieB555 Apr 18 '13 at 18:44
    
Ah, I was looking at the character model and missing the walls. I agree with @dadooGames's assessment. –  Seth Battin Apr 18 '13 at 19:17

1 Answer 1

Thanks to dadoo Games my problem is solved. He was correct I needed to change my sampler state to wrap.

I added this to my draw function to get it working:

GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.