skydave Posted November 23, 2009 Share Posted November 23, 2009 Hi, I am trying to transfer uvs from one mesh onto another and I have an issue which I dont understand: The way I do it is to create a attribute per point containing the closest primitive of the reference geometry and its parametric uvs. I use xyzdist to get this information on a createattrib node. Then I use a point attribute which uses this information to get the value of the texture uv's from the reference mesh using primuv and here is my problem: the uv values seem to "snap" to the point/edges of the reference geometry and I dont seem to get the uvs from the closest point on the face. I guess I am using primuv wrong or I miss something somewhere else. Can someone give me an idea how to do it? Many thanks, David P.S.: dont know how to embed images into a hip so there is a UV_testing.tif missing in $HIP closestUv_issue1.hipnc Quote Link to comment Share on other sites More sharing options...
edward Posted November 23, 2009 Share Posted November 23, 2009 I haven't looked at your file but my guess is that your method doesn't work because you're only using the uv values from from the closest point of your reference geometry. What you actually want is uv interpolation on your target geometry from say the 3-4 closest point neighbours of your reference geometry. Try just using AttribTransfer instead. Quote Link to comment Share on other sites More sharing options...
skydave Posted November 23, 2009 Author Share Posted November 23, 2009 I haven't looked at your file but my guess is that your method doesn't work because you're only using the uv values from from the closest point of your reference geometry. What you actually want is uv interpolation on your target geometry from say the 3-4 closest point neighbours of your reference geometry. Try just using AttribTransfer instead. Thanks for your input Edward. The problem with attributeTransfer is, that it remaps the whole texture space to the target geometry whereas I want only parts of the texturespace covered by the target geometry to be transfered. I attach an image to show what I mean: you see the source geometry on the bottom and the target geometry (the triangle) above. The triangle convers all the uvspace of the source geometry so you see the whole image on the triangle. But what I want is that the triangle only picks up the uvs from the closest points on the reference geometry so that in this case the triangle contains the red 3 in its upper right edge (not the red seven). Hope that makes sence. David Quote Link to comment Share on other sites More sharing options...
edward Posted November 24, 2009 Share Posted November 24, 2009 For one, I don't think you're ever gonna get a perfect transfer given that you need to do spatial interpolation unless your smaller triangle is gonna fit directly on top of the source grid. Secondly, you're not going to get a good transfer anyhow with such a low polygon density in the source geometry. In anycase, here's a rough match using AttribTransfer. closestUv_attribTransfer.hipnc Quote Link to comment Share on other sites More sharing options...
rjpieke Posted November 24, 2009 Share Posted November 24, 2009 I haven't looked at your file but my guess is that your method doesn't work because you're only using the uv values from from the closest point of your reference geometry. What you actually want is uv interpolation on your target geometry from say the 3-4 closest point neighbours of your reference geometry. Try just using AttribTransfer instead. So what does the primuv command do, if not this kind of interpolation? Quote Link to comment Share on other sites More sharing options...
edward Posted November 24, 2009 Share Posted November 24, 2009 I never took a look at the expressions. Thinking about it some more, the problem might be the inconsistent interface of uv's for polygons expected by the different expressions. Or the expressions could just have an error. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.