Michael1 Posted June 26, 2009 Share Posted June 26, 2009 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 Quote Link to comment Share on other sites More sharing options...
sam.h Posted June 29, 2009 Share Posted June 29, 2009 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. Quote Link to comment Share on other sites More sharing options...
Michael1 Posted June 29, 2009 Author Share Posted June 29, 2009 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. Quote Link to comment Share on other sites More sharing options...
Michael1 Posted June 30, 2009 Author Share Posted June 30, 2009 Does anybody else know a solution? Thank you Quote Link to comment Share on other sites More sharing options...
spev Posted July 1, 2009 Share Posted July 1, 2009 Have you tried the attr transfer SOP to do this... Quote Link to comment Share on other sites More sharing options...
Michael1 Posted July 1, 2009 Author Share Posted July 1, 2009 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. Quote Link to comment Share on other sites More sharing options...
sam.h Posted July 3, 2009 Share Posted July 3, 2009 (edited) 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 July 3, 2009 by sam.h 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.