- Home /
How to Align Texture on 2D Hex Mesh - UV?
I have a hexagon model that is what a hex would look like if was orthogonally projected, so essentially the model is smushed a bit. I want to put a simple skewed hexagon 2D texture onto it.
Here's the a top down ortho view of the hex.
And here's what the texture looks like.
The blank space around the text is totally transparent. I figured since the texture and the model are the same orientation it would basically just clip down perfectly, as if a projector was above the model aiming down onto it. However, when I apply the texture to the model with a material, it is rotated. :(
Like this:
It seems that the rectangular texture is being rotate to line up with the sloped bottom line, or more accurately its probably being skewed in UV to match it. Sadly, I don't remember much about UV stuff and its been ages since I've done any. I made the hex in Rhino3D and exported it. I don't really know how or even if you can UV map in Rhino, though I do have 3DS downloaded (no idea how to do most things in it). So, is there a simple solution in Unity? Or could anyone recommend some total "for dummies" level stuff on lining up textures and UV mapping? I'm not 100% what I need to do here.
Ideally, I could keep the texture files this way (with all that blank space around them) as it makes keeping the "perspective" and such much simpler than drawing with skewed "up" and such. However, if that needs to change I s'pose it needs to change.
Thanks so much for the help.
Here's the mesh: https://docs.google.com/file/d/0B4xf2Gj-oEJvWmZfNUM0VURqZmM/edit
Answer by Berenger · Jan 31, 2013 at 08:01 AM
Hey there.
The problem is indeed your UV. See the top left vertice of the square, in the middle of hex, it's UV is probably something like (0.25, 1.0). Note the y == 1.0, which means it's going for the top of your texture, where it's transparent.
Anyway, you canset the texture straight in photoshop / gimp, or use max to redo the UV. If you don't know max, it won't be easy to explain without picture, but you probably can find tutos about it. In short, you need a planar uv map on the correct axis (I suspect y, in max).
PS : or upload your mesh, I'll fix that in no time.
Good luck !
https://docs.google.com/file/d/0B4xf2Gj-oEJvWmZfNU$$anonymous$$0VURqZm$$anonymous$$/edit
Here's the mesh (in .3ds, seems to be the best export option from Rhino, if a different format is desirable I can do something else, tho .max doesn't seem to be an option). If you could fix it that'd just be awesome. : D
EDIT: I've been screwing around in Rhino and I think I've figure it out. Thanks so much for the pointers.
Also, you're going to have white artefacts at the edges of your hex. That comes from the color of the transparent parts of your picture. Sure the alpha is 0, but there is still the rgb even if you don't see it, and the shader will use those three channels as well.
So you need to open that texture on photoshop, duplicate the layer, scale the one on the bottom so there is no transparent color anymore. $$anonymous$$aybe blur that background a bit. The point is to remove the seams as much as possible. Then save it. If you want to keep the alpha channel, use the top layer (which still have alpha) to create a mask on the second one, the apply the mask, merge and save.
Your answer
Follow this Question
Related Questions
Split a mesh while using same UVs and texture position. 0 Answers
Texture on Unity Meshes 1 Answer
Apply texture to a mesh on all 3 sides 2 Answers
UV Mapping for 2D Meshes with 3 Vertices Only 1 Answer
Get texture with UV Mesh Mapping 0 Answers