17th January 2010

CamSlice ICE Particle Compound

For this I’ll be using a little bit of vector maths to ‘slice’ thorugh the point cloud, deleting any particles heading for the camera, for example to create a disc effect around a spherical emitter.

We can get the direction vector of the camera by subtracting the interest’s global position by it’s own. Nicely there’s actually a node already in ICE called ‘Get particle Movement’ which will give you the direction of each particle on the current frame. Before using these two bits of data we need to normalise them – a 3D vector includes a length as well as a direction, normalising them sets the length to 1, making it easier to compare direction, otherwise the dot product we’ll be doing next will give us some clunky-to-use numbers…

By taking the Dot Product of two normalised vectors we get a value between -1 and 1 which can tell us how close they are to being the same (with -1 being the opposite direction, 0 being perpendicular and 1 being the same direction). So by deleting every particle with a dot product above, say, 0.4 and below -0.4 we can cut the particles emitted from a sphere into a disc:

What I said but in annotated ICE form...

What I said but in annotated ICE form...

The benefit of doing this is if (for example) you’re emitting points from a sphere whilst modifying the colour – what can happen is that the particles on the outside block the ones at the core, meaning that you can’t see anything underneith.

For more of a visual example, I’ve put together a few quick tests to demonstrate:

Shot Breakdown:

Shot 1: Bog standard emit from sphere. Just colour (using the Add Colour on Distance node from my earlier blog), deleting particles at their age limit and a simple volume shader.

Shot 2: Same as above, but with the CamSlice node attached.

Shot 3: A more complicated ICE Tree set-up (see below)with the sphere moving in space

Shot 4: As above, but with the CamSlice ‘cut factor’ being animated from 1 to 0.2

Shot 5: Again, the more compex ICE Tree, with the camera being animated around the sphere

Shot 6: Same scene as Shot 5, but from a different camera unconnected to the CamSlice node. The camera from Shot 5 is represented by a blue rectangle

The more complex tree

The more complex tree

For the full ICE tree I played with the colour by using the Add Colour on Distance node when the particle was young, then dulling it when it got old. There’s a few basic forces thrown in there with just a little bit of turbulance added, plus a little push in the Z axis when they get older. The CamSlice node is being used only when the particles are young, once they’re set in the right direction I’ve left them to drift a little.

If you fancy using  this CamSlice technique, feel free to nab this compound and have a rummage around in there yourself. Just download the file below and change the full name from ‘CamSlicexsicompound.txt’ to ‘CamSlice.xsicompound’ and stick it into your user compounds folder – it’ll show up under ‘Tasks/Particles/Deleting Particles’. Don’t forget that if you only want to delete particles heading towards the camera (to keep the volume behind the emitter) then you just need to disconnect the ‘less than’ if node:

CamSlicexsicompound (text file – change to a .xsicompound to use)


No comments have been posted yet.


Leave a Reply