On 20/08/2014 at 10:34, xxxxxxxx wrote:
I'm trying to reverse lookup a position in space based on the UV coordinates of an object. The way I'm doing it now is loop through the UVW tag and compare each polygon/point's UVW coordinate to the one I'm looking for, and pick the closest. For obvious reasons this is far from accurate (on a low poly object it can be all over the place...). Have I overlooked some straight forward UVW > Position conversion somewhere?
On 21/08/2014 at 12:06, xxxxxxxx wrote:
I don't think there is a specific function to get a position from a set of UV-coordinates. This because a set of UV-coordinates can be found at various positions in space. Take Cinema's "Cube" primitive as an example. Each polygon has the exact same set of UV-coordinates, so any specific UV-set would be found on every polygon.
So what you need to do is to check if your given UV-coordinate is inside a specific polygon. If so you could calculate the position. One way may be to calculate the barycentric coordinates of your UV-set. With that barycentric coordinates you would be able to get the correct position from the polygon's vertices.