Maya 2020 fundamentals - modelling the real world
Get halfway through a model and find it's an unworkable mess? Can't add edge loops where you need them? Can't subdivide a mesh properly? If any of this sounds familiar check this course out.
# 1 26-08-2004 , 10:52 AM
Dann's Avatar
Registered User
Join Date: Feb 2003
Location: Los Angeles
Posts: 695

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.

# 2 26-08-2004 , 12:13 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
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!
# 3 26-08-2004 , 12:30 PM
Dann's Avatar
Registered User
Join Date: Feb 2003
Location: Los Angeles
Posts: 695
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]>>;

# 4 26-08-2004 , 01:06 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
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!
# 5 26-08-2004 , 01:45 PM
Dann's Avatar
Registered User
Join Date: Feb 2003
Location: Los Angeles
Posts: 695
See, there's the simple solution I was looking for.

Thanks.

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off