closestPointOnMesh problems

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  09 September 2004
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.
 
  09 September 2004
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
 
  09 September 2004
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
 
  09 September 2004
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
 
  09 September 2004
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?
 
  01 January 2006
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.
 
Thread Closed share thread



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 vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:54 AM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.