PDA

View Full Version : place object on UV @ x,y


JHN
09-15-2009, 08:44 AM
If I have an object with a clean UVmap like a plane or something and I want to place a object at UV coords nX,nY is there a quick way to get me there. Or do I always have to go through querying the mapfaces, and get the meshfaces from that then use the bary to get the exact position?!

Basicly I want patchDeform but for poly objects. Quickly query a UV position on a mesh, and with quickly I mean it should be able to handle 100 nodes in realtime. Patchdeform handles that perfectly but it's a compiled plugin offcourse.

Any pointers would be great!

-Johan

MatanH
09-15-2009, 09:31 AM
I did something like that a while ago,
you can build a mesh from the uvw channel
or simply copy the uvw channel to the mesh channel
then fire a ray at the wanted uv coordinates and you get the index of the face
and barycentric coordinates on it which you can convert to actual position on the original geometry.

JHN
09-15-2009, 09:48 AM
Matan, I thought about something like that, but how fast is it, I'm talking 100 objects moving constantly. I will definitely look into it though, thanks! Really would like to not use patches, since they're so poorly supported in max/maxscript.

-Johan

denisT
09-15-2009, 07:31 PM
If I have an object with a clean UVmap like a plane or something and I want to place a object at UV coords nX,nY is there a quick way to get me there. Or do I always have to go through querying the mapfaces, and get the meshfaces from that then use the bary to get the exact position?


do you want to calculate [X,Y,Z] position using [U,V] position as quick as possible?

JHN
09-15-2009, 07:47 PM
Hi Denis, yes that is basically it. I know for my particular case I always have a homogeneous UV set, so no 2 faces sharing the same UV. I know I can query UV's with the mapfaces etc. But I worry about the speed when it's done a lot.

-Johan

denisT
09-15-2009, 07:58 PM
Hi Denis, yes that is basically it. I know for my particular case I always have a homogeneous UV set, so no 2 faces sharing the same UV. I know I can query UV's with the mapfaces etc. But I worry about the speed when it's done a lot.

-Johan

it will be quick enough if you will do all calculations on tri mesh level using meshop interface

JHN
09-15-2009, 08:27 PM
You'd fire a ray or use the mapface route?

Thanks,
-Johan

denisT
09-15-2009, 08:29 PM
You'd fire a ray ?

Thanks,
-Johan


of cause not! calc [u,v,0] point to bary -> bary to [x,y,z] point ...

CGTalk Moderation
09-15-2009, 08:29 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.