Rotate along edge

Become a member of the CGSociety

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

Thread Tools Display Modes
  03 March 2009
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!
  03 March 2009
Can you post a picture of what you're trying to do? It's not very clear from the thread what went wrong.
  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
File Type: jpg scene_DestinyObj.JPG (55.3 KB, 21 views)
File Type: jpg scene_showRotateManipulator.JPG (58.6 KB, 18 views)
File Type: jpg scene_LocaAxisOfGroup1.JPG (82.4 KB, 20 views)
  03 March 2009
The manipulators in the last two images look identical, or am I missing something obvious!?
  03 March 2009
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.
  03 March 2009
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 12:00 AM.

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