Jump to content

uv / primuv issue - need help


skydave

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

post-5228-12589988932_thumb.jpg

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...