Jump to content

Giving particles uv texture co-ordinates


Recommended Posts

Hello,

I'm would like to give some particles which are sliding on an object uv texture coordinates from the object they are sliding on.

The collision pop provides uv co-ordinates of the primitive they are on, but not uv co-ordinates of the object they are on. I'm hoping there is a way to do this accurately, as I would like to give the particles some colour values based on this and it needs to be as accurate as possible for what I want to achieve with them.

Thank you.

A simplified example of what I'm trying to achieve:

odforce_particle_uvs.hipnc

Link to comment
Share on other sites

Hello,

I'm would like to give some particles which are sliding on an object uv texture coordinates from the object they are sliding on.

The collision pop provides uv co-ordinates of the primitive they are on, but not uv co-ordinates of the object they are on. I'm hoping there is a way to do this accurately, as I would like to give the particles some colour values based on this and it needs to be as accurate as possible for what I want to achieve with them.

Thank you.

A simplified example of what I'm trying to achieve:

odforce_particle_uvs.hipnc

Have you had a look at nearprim, near point and related functions ... they seem to be what you are after.

Link to comment
Share on other sites

Have you had a look at nearprim, near point and related functions ... they seem to be what you are after.

Thanks Sam, I have used nearpoint but that will only give me the nearest point and I'm guessing you mean to get the uv's from that. But what I would really like is its uv coordinate at its current position because nearpoint will give me an approximation since its only basing it on the nearest points' uv's. I hope I haven.t miss understood you,

Cheers.

Link to comment
Share on other sites

Thanks spev, yes I did try that, however this takes the uv's from the closest points. Which means they become a weighted average of those uv values which is causing me some issues. For instance if the particles are on a sphere. But because of the way a sphere has the uvs applied to it there will be some particles which a will receive uv's from points of very different uv values. I hope that makes sense, but the way the uv's are unwrapped points which are very close in camera space, could be very far apart in texture space. So this means the values given to the particles wont be accurate.

Link to comment
Share on other sites

Thanks Sam, I have used nearpoint but that will only give me the nearest point and I'm guessing you mean to get the uv's from that. But what I would really like is its uv coordinate at its current position because nearpoint will give me an approximation since its only basing it on the nearest points' uv's. I hope I haven.t miss understood you,

Cheers.

See also: xyzdist, primdist, pointdist

pointdist can get you the nearest point on a mesh, then you have the prim number and parametric U and V, I'm not sure how you can get an attribute with those though.

EDIT:

oops! the POP already gives you that ... :/

Attached a file that uses the ray SOP to get the attribute. The first ray SOP gets the normal of the nearest point on the surface. The second shoots a ray along the reverse of that normal to get an interpolated UV attribute. appears to be working ... :/

getUVs.hip

Edited by sam.h
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...