SimplyMaya Forums

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


SM Forums / Maya Questions / Animation / Aim Constraint Issue

Animation Animation & Rigging Related Topics

Join the conversation. Reply to post
 
Thread Tools
21-04-2008, 02:30 PM   #1
Dutch
Registered User
 
Dutch's Avatar
 
Join Date: May 2005
Posts: 49
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

  Reply with quote
21-04-2008, 02:39 PM   #2
Dutch
Registered User
 
Dutch's Avatar
 
Join Date: May 2005
Posts: 49
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.
  Reply with quote
21-04-2008, 11:52 PM   #3
Xander-0
Registered User
 
Xander-0's Avatar
 
Join Date: Feb 2005
Location: This Place
Posts: 220
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
  Reply with quote
23-04-2008, 12:14 AM   #4
Dutch
Registered User
 
Dutch's Avatar
 
Join Date: May 2005
Posts: 49
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.
  Reply with quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Camera Aim problems bauma1lp Maya Basics & Newbie Lounge 3 17-07-2014 02:26 PM
problem with aim constraint Monkey Wrench Maya Basics & Newbie Lounge 2 11-10-2009 12:35 AM
problem with aim constraint Radical Edward Maya Basics & Newbie Lounge 4 25-01-2006 09:44 AM
Aim Constraint problem on Hyd Arm Tut Scraggy_dog Maya Basics & Newbie Lounge 2 31-01-2004 02:31 AM
Lights and Constraint Aim TCH2003 Maya Basics & Newbie Lounge 2 22-07-2003 01:25 PM