View Full Version : snap one vtx to another of a different object

09 September 2005, 01:06 AM
I know one vertex in one object
float $pupil[]=`pointPosition -w pupil.vtx[70]`;

and the vertex in another.
float $eye[]=`pointPosition -w eye.vtx[600]`;

I want to snap the first vertex to the second one with only small difference in the z direction
float $delta=pupil[2] - 1.2

How can I now snap eye to pupil so that eye.vtx[600] get the coordinates of pupil.vtx[70] except in the z axis, where it should get $delta?

09 September 2005, 02:10 AM
use xform...

float $delta = 1.2;
float $pos1[] = `xform -q -ws -t eye.vtx[600]`;
xform -ws -t $pos1[0] $pos1[1] $delta pupil.vtx[70];


09 September 2005, 02:44 PM
Well, in fact the difference in the z direction would be
$delta = $pos[2] - 1.2 :)
I found that I can also move the whole object 'pupil' with
xform -ws -t $pos1[0] $pos1[1] $delta pupil;


CGTalk Moderation
09 September 2005, 02:44 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.