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 a very specific question which I feel should have a very short answer, but which I can't seem to find despite Googling on and off all day.

I'm trying to start with 3D graphics, and I read up a bit on the theory, etc. and I know the math. The issue is just with software. I'm trying to make a cube, which appears to be made of dirt (honestly solid brown would be fine), to appear on the screen. Technically I'm using XNA but I don't think this affects the answer or question very much.

I know how to make a functioning mesh/texture combo appear on the screen properly (I've read http://msdn.microsoft.com/en-us/library/bb975644(v=xnagamestudio.31).aspx among others); the issue is producing the texture itself.

For example, with Blender, I can easily make a cube and stick a procedurally generated texture on it that looks pretty good, but when I export as, say, .fbx, I get a mesh (and I think no texture data) and it doesn't work (as in doesn't appear on the screen but doesn't give an error message, which is consistent with the "no texture data" hypothesis).

So one great answer would just be to tell me how to export texture data from Blender along with, or in addition to, the mesh.

One other great answer would be to tell me how to produce textures in a different (free) program that is perhaps better suited (Blender may not be the right choice, I don't know anything about it).

Either answer or some completely other kind of answer is fine. But I feel like this should be a simple problem to solve, and I don't think I can stand another 30 minute youtube video that doesn't answer the question.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

In Blender, you need to UV map a texture to your cube model. Then when you export your model (using the standard FBX exporter) it will contain a reference to that texture in addition to your UV coordinates on each vertex. Then if you render your cube using a BasicEffect, as in the tutorial you referenced, this would be when you iterate through the mesh's effects...

foreach (BasicEffect effect in mesh.Effects)

you just need to set TextureEnabled = true and Texture to your loaded texture content. See http://msdn.microsoft.com/en-us/library/bb464051.aspx, particularly step 4.

share|improve this answer
    
Yup, this was the response. To anyone who happens upon this question in the future, an excellent Blender 2.6 tutorial for this task can be found here: link –  Richard Rast Mar 16 '13 at 18:34

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.