Aim Constraint (6)

Hi All,

I am having a problem and was wondering if anyone can help. I have returned to Maya after a long absence and am going over the basics from scratch.

I have an object and am constraining a spotlight at it. As soon as I apply the constraint the light rotates 180 in Y and almost 25 in Z. Need less to say this is not the direction it should be. Any advice as to why this is happening and how best to over come the problem.

Thanks in advance,
mousemat

aim vector ia pointing teh worng way around! Se aim needs information on WHAT to aim too just saying aim sint enough imageine the computer beinga acaveman... giving hima a gun does not make him aim it correctly without teelling him what to aim where. likewise you need to tell whats considered up along theis axis too!

Should be ovious tough whan you look at the settings.

Ps dont doublepost!

QUOTE(Joojaa @ 11/19/05, 01:52 PM)
aim vector ia pointing teh worng way around! Se aim needs information on WHAT to aim too just saying aim sint enough imageine the computer beinga  acaveman... giving hima a gun does not make him aim it correctly without teelling him what to aim where. likewise you need to tell whats considered up along theis axis too!
Should be ovious tough whan you look at the settings.
[snapback]220194[/snapback]

As I said, Joojaa, I constrained the light at the object so is ought to be pointing at the object no matter where the object is placed.

mousemat

Well tehts what you think... think again (aiming is not taht easy, but youve probebly never figured taht conciously out since you did figure out this as a kid 1 year old, compueters didnt). how did you define the constraint aand what it is it aims for? What do you need for a aim.

Aim consists of 4 thibgs not 2! what to turn, where to turn to, what direction that defines the aim axis, what direction that defies the Up along of the aim axis.

Its a fundamental truth the fact taht humans dont think about it does not eman tehy work thatway.

Example (paste into emptyscene):

CODE
file -f -new;
defaultSpotLight(1, 1,1,1, 0, 40, 0, 0, 0, 0,0,0, 1);
move -r 0 0 -2;
spaceLocator -p 0 0 0;
select -tgl spotLight1;
aimConstraint -offset 0 0 0
             -weight 1
             //NOTE THEESE VECTORS!
             -aimVector 1 0 0
             -upVector 0 1 0
             -worldUpType "vector"
             -worldUpVector 0 1 0;

defaultSpotLight(1, 1,1,1, 0, 40, 0, 0, 0, 0,0,0, 1);
move -r 0 -2 -2;
spaceLocator -p 0 -2 0;
select -tgl spotLight2;
aimConstraint -offset 0 0 0
             -weight 1
             //right vector wrong point
             -aimVector 0 0 -1
             -upVector 0 1 0
             -worldUpType "vector"
             -worldUpVector 0 1 0;

defaultSpotLight(1, 1,1,1, 0, 40, 0, 0, 0, 0,0,0, 1);
move -r 0 2 -2;
spaceLocator -p 0 0 0;
move -r 0 2 0; // lets move teh piot too!
select -tgl spotLight3;
aimConstraint -offset 0 0 0
             -weight 1
             //right vector
             -aimVector 0 0 -1
             -upVector 0 1 0
             -worldUpType "vector"
             -worldUpVector 0 1 0;

PS pople dont be supprised if the right answer is something unexpected. Thats why you couldt solve it yourself since you failed to considear all the sides.