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'm writing a game which uses obj files. I created an object in blender and I applied texture without UV coordinates and my question is: how to export this object to obj file, but with texture coordinates?

share|improve this question
1  
If you don't create the UV co-ordinates in blender in the first place, you're not going to be able to export them. –  Jonathan Connell Aug 18 '11 at 10:25
    
Hmm, ok, and it is possible to generate texture coordinates in blender? –  m4tx Aug 18 '11 at 11:08
2  
Yes, but you would be looking for a blender tutorial then. en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics –  Jonathan Connell Aug 18 '11 at 11:17

1 Answer 1

up vote 9 down vote accepted

As you already noticed, there's no way around UV coordinates for games. Thankfully, blender comes with some very good UV unwrapping tools.

The simplest way to get UV coordinates from a 3D model in blender is to use Smart UV Project. You can do that by pressing U while in edit-mode and then select "Smart UV Project" from the menu.

This creates UV "patches" given some angular threshold. The result can look like this:

UV coordinates created by "Smart UV Project"

Done, you've got UV coordinates now. However, these coordinates are most likely not that useful, since you'll end up with a ton of seams. A good unwrapped mesh has less seams, preferably at places where they can easily be hidden (eg. where an uniform color meets) or where the seams will be obstructed by other geometry. That's why you usually mark the seams yourself (in edit-mode select the edges that should be a seam and press Ctrl + E and select "Mark Seam" in the menu). Then use the regular "Unwrap" (not "Smart UV Project") to unwrap the mesh,

Good UV unwrapping is hard and requires practice. This video-tutorial might help you getting started.

share|improve this answer
    
It look like the video-tutorial link is false as it point to this gamedev question. –  Valkea Aug 18 '11 at 13:06
    
@Valkea: Ouch, thanks for checking! Fixed it. –  bummzack Aug 18 '11 at 13:22

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.