Introduction to Maya - Modeling Fundamentals Vol 2
This course will look in the fundamentals of modeling in Maya with an emphasis on creating good topology. It's aimed at people that have some modeling experience in Maya but are having trouble with complex objects.
# 1 18-01-2003 , 08:36 AM
silva's Avatar
Subscriber
Join Date: Dec 2002
Location: New Zealand
Posts: 84

Aiming Cameras on Objects

Hi, I'm working through a tutorial at the moment, just building a simple rocket ship and animating its takeoff, it is real basic stuff for most ppl, I'm finding it ok so far but I'm stuck when I come to spotlights... the tutorial says to position 3 spotlights which I have done, then what I have to do is select a spotlight and the rocket, then make the spotlight always focus on the rocket, I think it was something like Constrain > aim ... or something, anyways when I do this it says it worked, like in the hypergraph there is a connection made between the spotlight and some other node which must represent the connection .... but the spotlight itself is not pointing at the rocket, my question is why? I cannot change the position of the spotlight to face the rocket, and thats sposed to be done automatically by aiming it at the rocket... any ideas?


Sorry If ive managed to confuse you even more !

# 2 18-01-2003 , 08:49 AM
mark_wilkins's Avatar
Registered User
Join Date: Jan 2003
Posts: 161
It's a matter of your aim axis.

There are a few ways to deal with this problem.

First, I think you can type an aim axis into the option box for the aim constraint menu item. This is probably the hardest way to go about it because you'll have to figure out what numbers correspond to the correct direction (although I suspect that the spotlights point in positive z in their local space.)

Second (and this is my favorite overall trick for dealing with constraints, you can GROUP the light and aim-constrain the parent group. Then, you'll still be able to rotate the light itself after the fact.

This is a nice trick for cameras where you want the camera to follow something like a vehicle but you want to add animation (like camera shake) on top of the motion of the vehicle, or you want to be able to tumble and position the camera from the camera view, which constraining the camera directly would normally prevent.

Another possibility that isn't quite as flexible is to select the aim handle for the light (you'll have to turn it on, but the light has one) and point-constrain that to the rocket IF you can do that (I can't remember if you can constrain that handle and my computer with Maya is packed for moving at the moment.)

-- Mark


Mark R. Wilkins
author of MEL Scripting for Maya Animators
www.melscripting.com

Last edited by mark_wilkins; 18-01-2003 at 08:52 AM.
# 3 19-01-2003 , 12:48 AM
silva's Avatar
Subscriber
Join Date: Dec 2002
Location: New Zealand
Posts: 84
I'm a bit confused now, just reading the documentation I dont see why it wont work when I follow the instructions.. I have the rocket ship near the origin and the pivot point is just below the origin, I place the spotlight up and away from the ship, when I create it it looks as if it is facing the origin kinda, so I select the rocket , then the light, constrain > aim ... and when I do this the light then aligns with the x axis and faces out along that, NOT at the ship, now from reading the manual it says something that the lights x axis will be now aimed toward the pivot point of the rocket, but its not !! Surely there has to be an easy way to solve this !

I couldnt quite follow your instructions mark, sorry, I'm pretty new to all this, and I wouldnt know how to find the coordinates to point the spotlight at.

Basically what is going to happen is the rocket will take off and I want the spotlight to always focus on the rocket, any ideas? You are right that it does have to do with the aim axis. If I typed an aim axis into the constraint menu then that wouldnt be connected to the rocket would it? When the rocket took off the camera would still be focusing on that aim axis? Don't they have to be connected somehow?

And when you say group the light and aim constraint to the parent group, what is the parent group? The rocket?

# 4 19-01-2003 , 03:29 AM
Registered User
Join Date: Jan 2003
Location: NZ
Posts: 31
I remember trying that very same tutorial some time ago and having the exact same problem. I found the problem was the same for the lights and then the camera as well. From memory, the tutorial gets you to have the camera follow the rocket as well.

I spent ages back then playing around (basically ended up doing option 1 above). I have just spent some time playing with the old file and here are the things I had to do:

I basically aimed the light at the rocket manually,

then selected the rocket first and then the light,

selected Constrain/Aim options and set the following:

Aim Vector: 0 0 -1 (x,y,z)
Up Vector: 0 1 0 (x,y,z)
World Up Vector 0 1 0 (x,y,z).

Maybe this will work for you. I tried it this afternoon on all lights and camera and they followed the rocket perfectly. To make sure of this I selected each light and camera individually and set the perspective view to Look Through Selected, then played the anim.

Why these settings worked is beyond me. I even tried reading the help files!! but got lost in the jargon.

# 5 19-01-2003 , 08:33 AM
silva's Avatar
Subscriber
Join Date: Dec 2002
Location: New Zealand
Posts: 84
Thanks alot, I'll try that and let you know how it goes.. I'm teaching myself how to use Maya and I'm trying to understand concepts behind what I'm doing, but I guess sometimes you just gotta not ask questions and just do it, why does it work? who cares as long as it works user added image

# 6 19-01-2003 , 01:49 PM
mark_wilkins's Avatar
Registered User
Join Date: Jan 2003
Posts: 161
Actually I find it's usually a good idea to ALWAYS try to know WHY things work because if you don't you'll find the disconnect eventually bites you in the ass. :/

If you've ever fiddled with the aim vector, up vector or world up vector options in the option box, remember that changed values will "stick" and then become the default for use anytime that you don't open the option window and edit those settings.

Again, as I suggested, the Aim Vector setting is almost certainly the issue. Changing the Aim Vector picks a direction in local coordinate space for the light that gets aimed at the target.

The Up Vector and World Up Vector settings control the orientation of the aimed object around the aim vector, so for a spotlight it probably won't matter what those settings are because it's circular and all orientations around the center axis amount to the same thing.

-- Mark


Mark R. Wilkins
author of MEL Scripting for Maya Animators
www.melscripting.com
# 7 19-01-2003 , 11:41 PM
Registered User
Join Date: Jan 2003
Location: NZ
Posts: 31
Cheers Mark for the input. Your simple explanation of the various vectors has cleared some stuff up for me in my own head.

I am another one trying to teach myself Maya and work things out as I go.

Most stuff seems fairly simple to understand so far. The help files had me confused after trying to read all about the vectors in there. I haven't had to try that kind of animation again so left it for another time.

Steve

# 8 20-01-2003 , 05:26 AM
silva's Avatar
Subscriber
Join Date: Dec 2002
Location: New Zealand
Posts: 84
Thanks Mark, I managed to get it working from what you said.. but now I have another problem, all the lights are going and I'm in the middle of animating its takeoff, I have it all working except for one little bit. When the rocket takes off (the animation is controlled by dynamics like impulse & Gravity), it slows due to gravity etc, but when it hits the ground it is SUPPOSED to bounce off the ground, but instead when it hits it keeps going and the ground is pushed down with it, I need to lock the ground in place somehow, any ideas?

# 9 20-01-2003 , 07:07 PM
Registered User
Join Date: Jan 2003
Location: NZ
Posts: 31
Sounds like you made the ground an Active Rigid Body instead of a Passive Rigid Body.

An active rigid body will move when hit by something else - in this case the rocket.

A passive rigid body will act like a solid object but will not move/distort when hit by something else.

Making the ground a passive rigid body should solve your problems.

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads