SimplyMaya Forums

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

Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 26-08-2004, 10:52 AM   #1
Dann
Registered User
 
Dann's Avatar
 
Join Date: Feb 2003
Location: Los Angeles
Posts: 695
Thanks: 0
Thanked 2 Times in 2 Posts
Default jitter

Does anyone know of a good way to add some random jitter to a poly object. I'm not talking about the whole object, but rather the vertices. I tried making it a softbody, and adding some turbulence, but that only seems to make the verts move (albeit randomly) consitantly in a direction. I just want each vert to move a little bit each frame, never diverting too far from it's original position so that the basic shape is always still visible.

Anyone know what I'm talking about here or am I making no sense whatsoever?

Thanks.
Dann is offline   Reply With Quote
Old 26-08-2004, 12:13 PM   #2
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Did you animate the phase attributes of your turbulence field?

here's one way:
turbulenceField1.phaseX = time;
turbulenceField1.phaseY = time;
turbulenceField1.phaseZ = time;
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 26-08-2004, 12:30 PM   #3
Dann
Registered User
 
Dann's Avatar
 
Join Date: Feb 2003
Location: Los Angeles
Posts: 695
Thanks: 0
Thanked 2 Times in 2 Posts
Default

yeah, I tried that (and just tried again to be sure). Each particle (vert) of my soft body keeps traveling. It doesn't jitter. However, I've put together some nifty code that does the trick. I'm not the best scripter so pardon if it's overly complex, but it works. Drop it on a soft body as a Runtime expression and watch it wiggle. Edit the $variance and $magnitutde to fit the scale of your model.

float $variance = 0.01;
float $magnitutde = 0.003;

vector $pos = position;
float $posfloat[];
$posfloat[0] = $pos.x;
$posfloat[1] = $pos.y;
$posfloat[2] = $pos.z;

float $startPosX[];
float $startPosY[];
float $startPosZ[];
int $ID = particleId;
if (frame == 2)
{
$startPosX[$ID] = $pos.x;
$startPosY[$ID] = $pos.y;
$startPosZ[$ID] = $pos.z;
}

$posfloat[0] += rand( ($magnitutde*-01) , ($magnitutde*01));
$posfloat[1] += rand( ($magnitutde*-10) , ($magnitutde*10));
$posfloat[2] += rand( ($magnitutde*-30) , ($magnitutde*30));

if ( ($pos.x - $startPosX[$ID]) > $variance || ($startPosX[$ID] - $pos.x) > $variance )
{$posfloat[0] = $startPosX[$ID];}
if ( ($pos.y - $startPosY[$ID]) > $variance || ($startPosY[$ID] - $pos.y) > $variance )
{$posfloat[1] = $startPosY[$ID];}
if ( ($pos.z - $startPosZ[$ID]) > $variance || ($startPosZ[$ID] - $pos.z) > $variance )
{$posfloat[2] = $startPosZ[$ID];}


position = <<$posfloat[0],$posfloat[1],$posfloat[2]>>;
Dann is offline   Reply With Quote
Old 26-08-2004, 01:06 PM   #4
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Well, if you do the softie with a goal (weight < 1), you should get jitter with a turbulence field. Worked for me at least (or i'm thinking of a different effect)...
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 26-08-2004, 01:45 PM   #5
Dann
Registered User
 
Dann's Avatar
 
Join Date: Feb 2003
Location: Los Angeles
Posts: 695
Thanks: 0
Thanked 2 Times in 2 Posts
Default

See, there's the simple solution I was looking for.

Thanks.
Dann 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.