Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to find an approach to the problem of generating texture maps for non-convex polyhedrons without using a design tool like Maya. Specifically, I am mapping simulation results data onto a 3D surface, and I need to write code which generates the maps.

One generic approach uses a gradient color brush as an overall texture to just map colors, but if the facets in the polyhedron are very narrow or the mapped (u,v) coordinates are very far apart on the same facet, the image gets noisy. Another approach employs Phong or Gouraud Shading, but those features are missing in some 3D libraries which favor texturing over specifying colors at each vertex. So, I'm looking for a way to get a good texture map generated.

If it helps in identifying a correct algorithm, all of the surfaces entirely enclose a 3-D space, there is no facet normal data, and I'll be able to identify a "parting line" which segregates one part of the surface from the other, as one might in order to create a mold for the shape.

share|improve this question
I think you need to say quite a bit more about the problem. What are these "simulation results", what kind of surfaces are you mapping them on to, and what properties do you need the mapping to have? – Gareth Rees Sep 27 '13 at 15:37
The simulation results are uniform (non-sparse) 3D arrays containing single precision values. There is a neighboring array of short integers which approximates the 3D mesh; a "1" value in that array corresponds to a part of the enclosed region of the polyhedron. I'm mapping to non-convex 3D surfaces more complex than can be mapped with a simple unrolling texture mapper or a spherical ray casting approach. Think of an American gallon milk jug or similar shapes that can be produced in plastic or metal molds. – Rob Perkins Sep 28 '13 at 16:04

Your Answer


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

Browse other questions tagged or ask your own question.