# Drawing a distance map on a mesh

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

## Recommended Posts

Hello folks, I have the following problem to solve:

I created a fitting algorithm that basically fits a superquadric to a set of points which are the vertices of a mesh. I have a mapping that can project every point on the mesh to its closest point on the superquadric surface. This mapping also measures the distance between a mesh point and its closest sq surface point. What I now need to do is to de facto reverse the mapping, that means I have points liing on the sq surface an I need to assign a color value to them given by the closest mesh point.

Basically, I need to project the whole mesh surface onto the sq.

So far, I had the following idea:

- Create a copy of the mesh model
- Project every point of the copy mesh model to its closest surface point on the sq (this means deforming the model so it roughly looks like the sq).
- Use this deformed model as some kind of the texture.

Do you have a better idea? If no, what is the best method to achieve what I wrote above?

Thanks alot!

Ok, I'll write it again more shortly:

- I have a mesh. The mesh's vertices are colored according to their closest distances to an sq surface.
- I have an sq.
- For every vertex on the mesh, I can determine its closest vertex on the sq surface.
- What I need to do: For every sq point, determine its closest vertex on the mesh and sample its color value.
- The problem: I have no sq point -> mesh point mapping
- The idea: Somehow create a 3D texture from the mesh and let the GPU do the sampling.

[Edited by - Desperado on August 25, 2010 3:46:09 AM]

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633704
• Total Posts
3013460
×