Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Dynamics & Special Effects (https://simplymaya.com/forum/forumdisplay.php?f=33)
-   -   jitter (https://simplymaya.com/forum/showthread.php?t=13229)

Dann 26-08-2004 10:52 AM

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.

kbrown 26-08-2004 12:13 PM

Did you animate the phase attributes of your turbulence field?

here's one way:
turbulenceField1.phaseX = time;
turbulenceField1.phaseY = time;
turbulenceField1.phaseZ = time;

Dann 26-08-2004 12:30 PM

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]>>;

kbrown 26-08-2004 01:06 PM

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)...

Dann 26-08-2004 01:45 PM

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

Thanks.


All times are GMT. The time now is 09:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018