SevenString
10-10-2005, 07:18 PM
Here's the deal:
From a mesh, I need to, at minumum, derive the world-space position from a given UV coordinate.
pointOnSurface does this quite nicely for NURBS surfaces.
However, pointOnMesh doesn't work in the same way. Instead of returning a position, the call attaches an info node. pointOnMesh has the additional requirement that one must provide a particular face index. My guess is that this requirement is due to the fact that UV mapping can be arbitrary for mesh surfaces, leading to the potential of having more than one surface position for any given UV.
As a side note, In desperation, I have written a MEL command plug-in that would give me the position on a mesh from an input UV, with the assumption that there is no case where two or more faces share any UV space. However, I don't want to trust this plugin because it is untested, but moreso because it probably won't give interpolated results that sync up properly with other maya-based utilities such as the surfaceInfo shader plugin.
The bottom line: Without "knowing" what face is being tested, is there some simple way to get a world-space surface coordinate from a given mesh with a given UV?
I feel like I'm jumping through hoops, for something that Maya/MEL probably has as an intrinsic component. But since the documentation on this sort of thing is a little spotty, perhaps there is a command or command usage of which I am unaware that would solve my problem.
Thanks in advance to anyone who can help.
From a mesh, I need to, at minumum, derive the world-space position from a given UV coordinate.
pointOnSurface does this quite nicely for NURBS surfaces.
However, pointOnMesh doesn't work in the same way. Instead of returning a position, the call attaches an info node. pointOnMesh has the additional requirement that one must provide a particular face index. My guess is that this requirement is due to the fact that UV mapping can be arbitrary for mesh surfaces, leading to the potential of having more than one surface position for any given UV.
As a side note, In desperation, I have written a MEL command plug-in that would give me the position on a mesh from an input UV, with the assumption that there is no case where two or more faces share any UV space. However, I don't want to trust this plugin because it is untested, but moreso because it probably won't give interpolated results that sync up properly with other maya-based utilities such as the surfaceInfo shader plugin.
The bottom line: Without "knowing" what face is being tested, is there some simple way to get a world-space surface coordinate from a given mesh with a given UV?
I feel like I'm jumping through hoops, for something that Maya/MEL probably has as an intrinsic component. But since the documentation on this sort of thing is a little spotty, perhaps there is a command or command usage of which I am unaware that would solve my problem.
Thanks in advance to anyone who can help.
