Maya Texture based Velocity...


#1

I’m trying to get a map to drive emitter speed ort on creation PP velocity.

What I have, works for a plane, but not a 3d form.

float $pU = nParticleShape1.parentU;
float $pV = nParticleShape1.parentV;
float $texMap[] = colorAtPoint -o RGB -u $pU -v $pV grayTex;
float $iniVector[] = getAttr nParticleShape1.velocity;
vector $workVector = unit <<$iniVector[0],$iniVector[1],$iniVector[2]>>;
float $emitSpd = getAttr emitter2.speed;
nParticleShape1.velocity = $emitSpd * $texMap[0] * $workVector;

grayTex is the fractal we see.

This is what happens:

2 things:

A: It’s only going in one direction. Particles are not emitting in the normals direction PP It randomly changes the direction on each time I run the sim.

B: Slower than Molassas.

What am I doing wrong? I’m afraid I don’t have a handle on the logic of how MEL stores and manipulates the vector information.

The way I’m hoping it would be used is that there was some sort of PP velocity or speed attribute which would be multiplied to the $texMap variable Perhaps even have the velocity generated by emitter1.speed be converted to a vector velocity attribute and then be multiplied by the infor at colorAtPoint or even nearestPointOnMesh attribute.

It’s like I know a bunch of big words, but feel like I can’t speak-a de language.

Ideas?

P


#2

Im not sure colorAtPoint works with 3D texture, try using a 2D one and see if that changes anything. Plus change the output to -A rather than -RGB.

Also this is easily achieved with SOuP even if 3D texture.