PDA

View Full Version : aim constraint,up vector and scale of up vector.żup vector depends on scale?


shenmue
10-22-2007, 07:53 PM
Hi

I have spend 5 hours trying to fix this simple problem,but something is missing.
I just created 3 locator.One of them is aim constrained to the other,having an up object as an up vector.
Here is the simple code:

//create locator
spaceLocator -n "aim";xform -cp;
spaceLocator -n "objectAimed" -p 0 10 0;xform -cp;
spaceLocator -n "upVector" -p 5 0 0;xform -cp;

//create aim constraint to the "objectAimed",making "upVector" as object up vector
select -r objectAimed ;
select -tgl aim ;
aimConstraint -offset 0 0 0 -weight 1 -aimVector 0 1 0 -upVector 1 0 0 -worldUpType "object" -worldUpObject upVector;




I don´t understand why when I move the up vector in Z,the constrained locator doesn´t rotate.
But if I scale the up vector locator and do the same translation,the constrained locator do rotate this time.Could somebody explain to me this hole aim up vector stuff?I am going crazy here.

thanks

tbaypaul
10-22-2007, 11:36 PM
rotates fine here....

shenmue
10-22-2007, 11:45 PM
rotates fine here....
did you just translate the up vector in z and the aim locator looked at the up vector?
:argh:.I mean,if I rotate the up vector around the aim locator(in plane XZ),that aim locator look at the up vector.But if I translate the up vector just in Z axis,the aim locator doesn´t move.
But if I change the scale of the up vector,the aim locator rotates if I move it just in Z axis
:banghead: I don´t get...

shenmue
10-23-2007, 05:55 PM
No body??...I guess that is some weird stuff to ask about...
any way.I´ll keep trying to fix it

tbaypaul
10-23-2007, 06:18 PM
if I move the up vector in just z the aim rotates as expected....I'm not sure I understand you ........can you print screen to show us.

shenmue
10-23-2007, 06:46 PM
FINALLY!!
thanks for your replys tbaypaul;
It turns out that the problem was the way I create the locator in Mel,which is
spaceLocator -n "my locator" -r -p 0 40 0;xform -cp;
doing the locators that way was the problem.I am not sure why....maybe the xform -cp.
Well,so if do create the locator in the origin and then move them and do the aim,every thing works fine.But if create them , positioning them directly in space and then centering the pivot,every thing is messed up.I also tryed deleting history and freezing transformation after,but the problem persisted.

So I guess ,I´ll just create them in origin and move them.

God...more than 6 hours waisting time for that...:shrug:

CGTalk Moderation
10-23-2007, 06:46 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.