Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 21-04-2008, 03: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, 03: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 22-04-2008, 12:52 AM   #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, 01: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

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.