SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Animation / Aim Constraint Issue
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 21-04-2008, 02:30 PM   #1
Dutch
Registered User
 
Dutch's Avatar
 
Join Date: May 2005
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default Aim Constraint Issue

I'm having an issue with aim constraints. In the image below are two gun turrets: one on top of the ship and one on the bottom. I went ahead and grouped all the items in the turret which would have up/down rotation and placed a constraint on them (ensuring that the center of rotation was correct for the group). I quickly verified that this worked by moving the locater, I linked them to, up and down. Everything appeared to be working correctly. Then I grouped everything that would rotate side to side and made sure the pivot was in the center. I made an aim constraint on the same locater that only moved in this axis. A quick side to side test verified that it was working (or so it seemed).

The problem is that when I move the locater toward the rear of the ship the turret moves in an unpredictable manner. The 180 degrees in front behave exactly as I want but the 180 degrees behind don't work.

Even more odd is the fact that I duplicated the same steps on the lower turret and I don't end up with the same issue. It has 360 degrees of movement that works as expected.

I created a sensor dish toward the rear of the ship (also on the upper side) with similar movement requirements as the upper turret. After following the same process, I run into the same issue as the upper turret.

In the help file (yeah, I actually checked it) I found a vague reference that said something about aim constraints acting unpredictable when the target nears the global up axis. I have no idea what this means or how to fix it. Does anyone have a clue as to what is going on?

Note: History on each item is deleted and translations are frozen. I'm using Maya 6.5

Dutch is offline   Reply With Quote
Old 21-04-2008, 02:39 PM   #2
Dutch
Registered User
 
Dutch's Avatar
 
Join Date: May 2005
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default

May have just found my own answer.
http://caad.arch.ethz.ch/info/maya/m...m3.html#177795

Something to do with the World up vector and the aim vector as it nears it. The fix involves changing or animating the world up vector. I'm not sure I want to do that. I may just put in a different animation control to save myself the trouble.
Dutch is offline   Reply With Quote
Old 21-04-2008, 11:52 PM   #3
Xander-0
Registered User
 
Xander-0's Avatar
 
Join Date: Feb 2005
Location: This Place
Posts: 220
Thanks: 0
Thanked 2 Times in 1 Post
Default

Actually, you can use a combinations of expressions and parenting to achieve the effect - no aim constraints needed.

Although I've found that the system doesn't point at it exactly - probably due to rounding errors (it gets noticeably better the farther away the target gets). But its pretty close regardless.

Setup - basically, just parent your gun in your turret to your turret base (or to whatever controls you have). Then, you'll need some variant of the following equations;
for the base:
base.rotateY = atan2d((target.translateX),(target.translateZ));
- this basically points the base at what would be the target's position seen from above.-
for the gun:
gun.rotateZ = atan2d(target.translateY, sqrt(target.translateX * target.translateX + target.translateZ * target.translateZ));
-this points the gun at the target vertically, and assumes that the gun is already pointing at it horizontally.-

the second equation is a little bit messy, and that's where most of the divergence is seen (most likely due to rounding errors). You should be fine with anything over 20 units away, though.

Actually, by bringing this up, you may have helped me come up with a way to solve an old problem of mine. Hope this helps!
__________________
Book Wise

http://X4nd5r.deviantart.com
Xander-0 is offline   Reply With Quote
Old 23-04-2008, 12:14 AM   #4
Dutch
Registered User
 
Dutch's Avatar
 
Join Date: May 2005
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for the tips

I actually ended up going back and using a control object with an orient constraint instead of the aim constraint. It works enough to get the job done. I doubt this will be going through any major animation, so getting any more involved would be a waste of my time.
Dutch is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

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

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.