# closestPointOnMesh problems

 Thread Tools Display Modes
 09 September 2004 bombadillo New Member closestPointOnMesh problems I used the closestPointOnMesh node to check the closest point but when I try to check the closest point it gives me different coordinates than he should. for example I have a pSphere1 object translated of 4 units along the Y axis so i write this in the script editor: /////////////////////////////////////////// createNode closestPointOnMesh; connectAttr pSphere1.worldMesh closestPointOnMesh.inMesh; setAttr closestPointOnMesh1.inPosition 0 0 0; float \$position[] = `getAttr ("closestPointOnMesh1.position")`; print \$position; ------- Result 0 7.62 0 ///////////////////////////////////////// The closest point to the origin should be the lowest vertex of pSphere1 but if I check its position with: ///////////////////////////////////////// pointPosition -w pSphere1.vtx[90] the Result is 0 3 0 and i know this is the right result. So, someone knows what is the result that closestPointOnMesh gives me. pleeease. It's all day I'm kocking my head on the table but still can't find a solution. Last edited by bombadillo : 09 September 2004 at 10:53 AM. share quote
 09 September 2004 James Jacobs James Jacobs Ziva Dynamics Vancouver, Canada If I remember correctly, this node makes the assumption that your units are set to centimeters. To correct the problem, you'll either have to set your current unit to centimeters, or pipe the output from this node into an expression or utility node network that will convert the position in centimeters to your current unit of measure. -hope this helps -jj __________________ ¤º°`°º¤ø,¸ ¸,ø¤º°`°º¤ø,¸ James Jacobs share quote
 09 September 2004 bombadillo New Member Thank you James. I made some test and i figured out that there is a proportional constant of 2,54 so i simply divided the result . Now everything works fine share quote
 09 September 2004 James Jacobs James Jacobs Ziva Dynamics Vancouver, Canada Originally Posted by bombadillo: Thank you James. I made some test and i figured out that there is a proportional constant of 2,54 so i simply divided the result . Now everything works fine Sure thing. As an aside, the closestPointOnMesh node seems to have another caveat. If your mesh contains 3 or N-sided polys, the "closest point" may be slightly off for those polys. It looks as though the the node calculates a normalized U and V along the first two edges of each poly in the mesh. Consequently, if the polys are N-Sided, not all of the poly surface will be mapped. If they are triangles, only half of the mapping will be meaningful. -jj __________________ ¤º°`°º¤ø,¸ ¸,ø¤º°`°º¤ø,¸ James Jacobs share quote
 09 September 2004 bombadillo New Member Strangelly everything works fine except than when I works with polyTorus. ???? I really can't figure it out. It gives me strange results. Is there something different between the costruction of a polyTorus and the other polygons? I checked the normals and they seem correct. So i really dunno. Does anyone know something about this? share quote
 01 January 2006 CGTalk Moderation Expert Thread automatically closed 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. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.