# What is 'box' mapping?

This topic is 4314 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm trying to texture a NURBS-based terrain. In this thread Yann L says...
Quote:
 You can simple use parametric texcoords, derived from the HOS splines. This works more or less OK, but can show weird stretching on certain parts. A better approach is to use a 6-planar mapping with seam blending. Similar to the 'box' UVW mapper in 3DSMax, but with blending to remove any visible seams.
What does Yann mean when he says 6-planar mapping with seam blending? Are there any papers on this topic, or can someone share some insight into how it works?

##### Share on other sites
I think he means cube maps. Imagine your object is surrounded by a cube whose faces are "projected" on your object.

See OpenGL Cube Map Texturing for details.

##### Share on other sites
I understand cube maps already, and I'm sure the techniques are similar, but I don't think that's what Yann's referring to. Cube mapping is generally a technique to map 6 different textures arranged in a cube onto an object. 6-planar 'box' mapping AFAIK is a method to generate texture coordinates for 2D texture on a 3D object.

It's similar in concept to the cylindrical or spherical mapping also found in most 3D packages. Anyway, some searching lended me the term "surface parametrization", but I don't know if that's related because I'm not finding my box mapping technique anywhere.

##### Share on other sites
I suppose worst case scenario I could take a look at the Blender source code to understand their box mapping but I'm really looking for description not code.

##### Share on other sites
Take the normal of the triangle, find its largest component. You get 6 possibilities: +X, -X, +Y, -Y, +Z, -Z. Perform a planar 2D projection depending on the case.. this is box mapping.

Y.

##### Share on other sites
Awesome! Much appreciated...

Now for seam blending, I think the reason you need this is because the texture coordinates on a cube can never match up perfectly, particularly on the top and bottom.

So what do you think of this algorithm. Each triangle is mapped onto a plane and given texture coordinates for each of its vertices. This is done for every triangle so sometimes there are multiple copies of vertices with probably different texture coordinates. To fix the seams, like vertices would be melded together and their tex coords averaged.

I haven't tried it yet ... but hopefully that would fix the problem.

##### Share on other sites
Quote:
 Original post by YsaneyaTake the normal of the triangle, find its largest component. You get 6 possibilities: +X, -X, +Y, -Y, +Z, -Z. Perform a planar 2D projection depending on the case.. this is box mapping.Y.

Box mapping must be synonymous with cube mapping as well, because that exact kind of transform is used to get cubemap texture lookups.

1. 1
Rutin
67
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• ### Forum Statistics

• Total Topics
633416
• Total Posts
3011780
• ### Who's Online (See full list)

There are no registered users currently online

×