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 10-11-2008, 05:52 AM   #1
bendingiscool
Subscriber
 
bendingiscool's Avatar
 
Join Date: Jul 2006
Location: London
Posts: 567
Thanks: 0
Thanked 1 Time in 1 Post
Default avoidance behaviour

Hi, I have a Rigid Body cylinder pottering around a scene driven by some simple expressions on the impulse. What I would like to do is avoid / go round other objects in the scene rather than just collide with them.

I'm guessing I would have to collect the worldspace of the object its coming close to or something like that?

Any ideas on this one would be very useful.

Cheers,

Chris
bendingiscool is offline   Reply With Quote
Old 11-11-2008, 02:37 AM   #2
bendingiscool
Subscriber
 
bendingiscool's Avatar
 
Join Date: Jul 2006
Location: London
Posts: 567
Thanks: 0
Thanked 1 Time in 1 Post
Default

Ok so far the I have 2 objects, one a passive RB, one a active RB that has an expression on its impulse to make it move in the Z direction.

Below is an expression that makes there colour change when getting with in a certain proximity of each other...

//get objects translates
vector $obj1=`getAttr obj1.translate`;
vector $obj2=`getAttr obj2.translate`;

//subtract one from other
float $mag = mag($obj2-$obj1);

//change colour when within certain proximity
if ($mag <= 10)
setAttr lambert1.color 1 .5 .5;
else
setAttr lambert1.color .5 .5 1;

This is showing it recognises the proximity, now how would I go about making the active RB go round the passive RB?

Thanks

Chris
bendingiscool is offline   Reply With Quote
Old 11-11-2008, 04:28 AM   #3
gster123
Moderator
 
gster123's Avatar
 
Join Date: May 2005
Location: Manchester Uk
Posts: 6,300
Thanks: 1
Thanked 51 Times in 45 Posts
Default

Could you not assign a radial fields magnitide to the closeness factor, so that when the object goes close to the other object a field (thats parented to the other object) then increases its magnitide based off the distance to "push" it away
__________________
"No pressure, no diamonds" Thomas Carlyle
gster123 is offline   Reply With Quote
Old 11-11-2008, 05:27 AM   #4
bendingiscool
Subscriber
 
bendingiscool's Avatar
 
Join Date: Jul 2006
Location: London
Posts: 567
Thanks: 0
Thanked 1 Time in 1 Post
Default

I like the idea, am currently workin on a way to do it without fields but will certainly give that a go.

Cheers as always,

Chris
bendingiscool 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.