Jump to content

how to transform P from UV space to World space in SOP ?


Recommended Posts

Hi guys i am trying to find a way to transform a position P in UV space coordinate to World space.


the only function that looks to do this are :

- primuv()

- prim_attribute()

Both looks to operate in the same way.


But they don't look to work in UV coordinate but with Per Primitive Parametric (u,v).


My goal is to have some point to slide on a poly object along UV.

By using primuv() or prim_attribute() i can only slide per Primitive uv. But i need to slide with per Object uv.


I can't find a way to solve this ... except by reducing my initial ambitions with a ray SOP ... :)


Thanks for your time !






Edit :

i have attach an exemple, that do exactly what i need , but the thing is that it must be a Nurbs object. I would like to mimic this but with a Poly Object.


Edited by sebkaine
Link to comment
Share on other sites

Many thanks for the links Pavel ! :)


The goal of the first post is to make point stick the object. unfortunatly he use :

- intersect() to get closest @primid + @primuv to fill the primuv() function

- but at the end he is still in Per Primitive parametric UV space not in UV space.

- so this trick i'm afraid will not allow me to animate U or V position according to UV map.


The second link is very interesting but i will have to drink a coffee or two before understanding all ... But

- it looks that's it's not possible in H do a P transform from uv:space to world:space

- that is quite surprising but i will try to investigate this further.


I will use a maya + houdini combo on this fx i guess, animating my particles along UV texture in maya and use the sop solver and post process in houdini.


Thanks again for your help !

Link to comment
Share on other sites

Well i have find a way to do what i want, but it's the ugliest / geeky / unfriendly way i could imagine ...


I take the mesh with the uv

- compute rest pos

- transform P from world to UV.

- animate point in 0,1 grid

- transfer rest pos from mesh to point

- transform point from 0,1 grid to rest pos


Edited by sebkaine
Link to comment
Share on other sites

  • 3 years later...

Hi! I'm bumping this thread. I come from 3ds max + TP and it offers something called "Surface Position", It does what Emmanuel already described. Now in houdini I faced the same problems, I'm really thankful that he provided this clever way to go around it. He uses attribute transfer to do the interpolation stuff for the xyxPos and promoted UVs from vertex to Points but this will cause problems on the seams and the way it is interpolating positions could cause some problems also. Maybe someone has an alternative or new ideas to this, I was thinking in a way of getting the prim number and then get and interpolation for the uvPrim, both from the UV attrib in the vertices(vertex already now to witch prim they come from so I have to ask for this index with UVs that are close the the value I'll input), maybe I'll hit a wall again, don't know.

Link to comment
Share on other sites

Quick update: Ok a function I didn't know about called "uvsample" was really promising sadly It makes the position jump and it seems that it is not getting what I expected (for some reason the uv coord : 0,0,1 doesn't go to the corresponding point pos defined with the seams) I'll share the file.


Link to comment
Share on other sites

  • 2 years later...

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.

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...