jhuangtw
03-28-2005, 05:23 AM
Hi all.
i'm trying to create some sort of a modifier node for polymesh, where it would take the inputs of multiple locators' world space as inputs, and based on them, recompute internal data and refresh the mesh.
i am having trouble trying to understand how to set it up so that the node is constantly watching these locators, and updating when the locators move.
also, the locators would be geometry-constrained to the mesh, and so far i dont have a clever way to find out which face of the polymesh the locator landed on. one (dumb) solution i thought of was to sort all the vertices and find the closest vert to the given locator position, then walk around the faces around the vert and find out which face the locator's position lie in. but that seems super inefficient to do on all locators. another possible way is maybe using the framebuffer somehow, where i could render the faceID into each pixel of the framebuffer, and then use the screenspace position of the locator to look up into the framebuffer and take the faceID. but i dont know how would be done in maya (set up and accessing the framebuffer) . i have a feeling that there should be a much easier way to do this (given worldspace, look up which face it lies in) with the maya API, could somebody point me in the right direction.
thank you for reading the long post, any help is deeply appreciated.
now i'm gonna go back and dig around the maya doc/devkit codes some more :)
i'm trying to create some sort of a modifier node for polymesh, where it would take the inputs of multiple locators' world space as inputs, and based on them, recompute internal data and refresh the mesh.
i am having trouble trying to understand how to set it up so that the node is constantly watching these locators, and updating when the locators move.
also, the locators would be geometry-constrained to the mesh, and so far i dont have a clever way to find out which face of the polymesh the locator landed on. one (dumb) solution i thought of was to sort all the vertices and find the closest vert to the given locator position, then walk around the faces around the vert and find out which face the locator's position lie in. but that seems super inefficient to do on all locators. another possible way is maybe using the framebuffer somehow, where i could render the faceID into each pixel of the framebuffer, and then use the screenspace position of the locator to look up into the framebuffer and take the faceID. but i dont know how would be done in maya (set up and accessing the framebuffer) . i have a feeling that there should be a much easier way to do this (given worldspace, look up which face it lies in) with the maya API, could somebody point me in the right direction.
thank you for reading the long post, any help is deeply appreciated.
now i'm gonna go back and dig around the maya doc/devkit codes some more :)
