I'm trying to attached a locator or cv to particles in a fluid container. I want to track thier path for further use. Does anyone know a way to do this?
QUOTE(chermandesign @ 11/10/05, 02:39 PM)
I'm trying to attached a locator or cv to particles in a fluid container. I want to track thier path for further use. Does anyone know a way to do this?
[snapback]219322[/snapback]
in expression editor
float $pos[] = particle -attribute position -order 0 particle1 -q;
nurbsSphere1.translateX = $pos[0];
nurbsSphere1.translateY = $pos[1];
nurbsSphere1.translateZ = $pos[2];
queries position of particle based on particle id, then assigns 0/1/2 values to x/y/z values for your object...
QUOTE(thirddan @ 11/11/05, 01:23 AM)
in expression editor
float $pos[] = particle -attribute position -order 0 particle1 -q;
nurbsSphere1.translateX = $pos[0];
nurbsSphere1.translateY = $pos[1];
nurbsSphere1.translateZ = $pos[2];
queries position of particle based on particle id, then assigns 0/1/2 values to x/y/z values for your object...
[snapback]219348[/snapback]
I tried this expression, but I couldn't get it to work. I'm trying it with a simple one first. If I have an emitter with particles and its called particle 1, I go into the expression editor and copy paste the expression, run the expression and I get sytax errors. help? What am I doing wrong?
QUOTE(chermandesign @ 11/11/05, 06:36 AM)
I tried this expression, but I couldn't get it to work. I'm trying it with a simple one first. If I have an emitter with particles and its called particle 1, I go into the expression editor and copy paste the expression, run the expression and I get sytax errors. help? What am I doing wrong?
[snapback]219399[/snapback]
i just realized that my expression has nothing to do with fluids so if you are trying to use it with fluids it won't work...
but for "instancing" an object to a particle it will work as long as the particle and object name are correct...
QUOTE(thirddan @ 11/11/05, 12:31 PM)
i just realized that my expression has nothing to do with fluids so if you are trying to use it with fluids it won't work...
but for "instancing" an object to a particle it will work as long as the particle and object name are correct...
[snapback]219410[/snapback]
So there is no way to track a particle in a fluid container? Thanks for your help, I'm new to fluids and I fell like such a newbie.
Fluids don't use particles( this is a little confusing as the wireframe display of a fluid uses random dots to indicate density ). The fluid values are stored on a fixed grid and pushed around using the velocity grid. You can use the commands fluidVoxelInfo and get/setFluidAttr to access the information on the fluid grids.
You can also use the fluid as a force to push around objects( like particles, rigid bodies and locators ). If you use it as a field set the conserve zero on the particles.
Duncan
QUOTE(DuncanBrinsmead @ 11/14/05, 03:39 PM)
Fluids don't use particles( this is a little confusing as the wireframe display of a fluid uses random dots to indicate density ). The fluid values are stored on a fixed grid and pushed around using the velocity grid. You can use the commands fluidVoxelInfo and get/setFluidAttr to access the information on the fluid grids.
You can also use the fluid as a force to push around objects( like particles, rigid bodies and locators ). If you use it as a field set the conserve zero on the particles.
Duncan
[snapback]219659[/snapback]
Could you use these commands to 'call' or 'get' postion of fluid attributes and have a locator be placed at loactions of voxels like you can with particles?
QUOTE(chermandesign @ 11/14/05, 01:28 PM)
Could you use these commands to 'call' or 'get' postion of fluid attributes and have a locator be placed at loactions of voxels like you can with particles?
[snapback]219667[/snapback]
I'm not sure what this would mean... you could have the locator jump to the position of the voxel with the most density, if that was what you wanted. A better technique would be to push the voxel in a continuous fashion using the velocities on the fluid. The best way to do this is to use the fluid as a field. You can have the objects move exactly with the density.
Each voxel is a bucket filled with density. The velocity grid determines how we transfer one bucket into another over time. FluidVoxelInfo can be used to give you the position of voxels, or the voxel at a position. Get and setFluidAttr can be used to query and set the values of the fluid voxel grids, including the velocity grids.
Duncan
You cannot think of fluids as you would particles... If you're a little familiar with physics, the difference between the two could be compared to the difference between quantic (particles) and ondulatory (fluids) physics... Nothing mathematical here, just a metaphor.
Though you could move an object around using your fluid as a field on rigid body, I would rather advise you to create a particle system, drive that using the fluid field (set conserve to 0 on particle system and it will faithfully follow your fluid's convolutions) and then attach your object to the particle.