# 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 !

Cheers

E

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.

slide.hip

Edited by sebkaine

##### 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 !

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

slide2.hip

Edited by sebkaine

##### Share on other sites

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.

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

UV_sample_Test.hipnc

##### Share on other sites

Hi, I was trying to move points  along UVs as well, here's a test that might help, based on Sebkaine's and Ronald's idea:

vop_uv_offset.hipnc

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account