snap one vtx to another of a different object

Become a member of the CGSociety

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

Thread Tools Display Modes
  09 September 2005
snap one vtx to another of a different object

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
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];

Make something idiot proof and they'll just build a better idiot
  09 September 2005
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;

  09 September 2005
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
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 07:57 PM.

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