Rotate along edge

 03 March 2009 bsdzhu New Member   portfolio bob zhu Technical Artist Shanghai, China Rotate along edge Hi, everyone, I have 2 objects(A, B) in my scene. What i want to do is: rotate A along an edge of B( edge name: BEdge, startingpoint: startP, endpoint: endP). I had placed rotatePivot of A at the position of startP, and when i tried to align the x-axis direction( imagining some animal fly across the red one of 3 rotate-manipulator circles, that's the direction) to the direction of BEdge, I was confronted with an unexpected direction. Here is my code: `````` //after placing rotatePivot, the x-axis direction is vector: (1, 0, 0) //find the angle to rotate float \$midRot[3] = `angleBetween -euler -v1 1 0 0 -v2 (\$edgeDirection.x) (\$edgeDirection.y) (\$edgeDirection.z)`; //now rotate it xform -r -ws -rotateAxis \$midRot[0] \$midRot[1] \$midRot[2] A;`````` the x-axis direction changed somewhat, but not at all overlapped with direction of BEdge. I am really confused with this problem, hope someone can help me out, Thanks in advance! share quote
 03 March 2009 cbamber85 Unemployed.   portfolio Camden Bamber Anybody need a TD in Yorkshire? United Kingdom Can you post a picture of what you're trying to do? It's not very clear from the thread what went wrong. __________________ www.cam-bamber.co.uk share quote
03 March 2009
Thanks for reminding me.

This is my scene:
Attach Files: scene_DesinyObj.JPG

Object A and C are grouped as group1(the 2 objects on the left).
The object showing its vertex number on is my destiny object.
I have placed rotatePivot of group1 at the position of vtx[6] of the destiny object.

What i want to do is:
Align local rotate x-axis of group1 with this edge:( vtx[6]->vtx[4])

The ideal result looks like:
Attach Files: scene_showRotateManipulator.JPG

and this picture(showing local rotating axis on)
Attach Files: scene_LocaAxisOfGroup1.JPG

Thank you!
Attached Images
 scene_DestinyObj.JPG (55.3 KB, 21 views) scene_showRotateManipulator.JPG (58.6 KB, 18 views) scene_LocaAxisOfGroup1.JPG (82.4 KB, 20 views)

 03 March 2009 ewerybody w°°t   portfolio eRiC Werner pyroTechnical Artist Berlin, Germany have you tryed Henry Korols Local tools? __________________ goodsoul.de share quote
 03 March 2009 cbamber85 Unemployed.   portfolio Camden Bamber Anybody need a TD in Yorkshire? United Kingdom The manipulators in the last two images look identical, or am I missing something obvious!? __________________ www.cam-bamber.co.uk share quote
 03 March 2009 bsdzhu New Member   portfolio bob zhu Technical Artist Shanghai, China cbamber85, yes, manipulators in the last two pictures are identical, I was trying to illustrate my thought in two ways. And thanks for your information, ewerybody, Busy now, but I will try this tool out. At this moment it looks promising for me. share quote
 03 March 2009 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.