PDA

View Full Version : Ground Marks from Impacting Object

 Mike Truly08-19-2009, 11:15 PMMAX2010_64 I have setup a PFlow (attached) where a blade repeatedly strikes the ground as it moves. I am trying to create particles that define precisely where the blade is penetrating the ground. I know I am doing something wrong but can't figure out exactly what it is. As the blade goes through the ground... one half of the particles fall through while the other half stay on the ground as desired. Thanks for taking a look (note: uses a Box3 Cache... don't know if that will be a problem).
Piflik
08-20-2009, 12:26 AM
I'd do it with collision spawn.

There are two ways you could try:

1. Spawn particles on the plane (you can limit it to the genral area, where the blade hits, to reduce the particle count) and define your sword as collision object. Where the sword intersects the plane, new particles will be spawned.

2. In essence the same as 1, but with switched roles. The blade is the emitter, and the plane the collision object.

JohnnyRandom
08-20-2009, 02:22 AM
number 2 for sure. :)

Mike Truly
08-21-2009, 08:22 PM
Thanks for these ideas! Will give these methods a try (sound simpler than what I'm doing). I'm currently on some other projects.

But in the scene I posted...

I distributed non-rendering particles on a plane, set the blade as a collision object, when the blade swings and hits the particles it spawns new particles which have gravity force and are then set to collide on another plane object and stick in place (leaving the shape of the blade mark).

This 'rube-goldberg' method partially works... but the thing I don't understand is why only half of the newly created particles stick but the others fall through? It's like the particles hit by the blade on the downstroke fall through but those hit by the upstroke stick as desired.

Thanks again.

JohnnyRandom
08-21-2009, 09:04 PM
It could be by the time the collision registers the new particle is created past the point of collision. So in reality the spawn is happening underneath, iffy. More than likey it has to do with the collision object normals. In the example I posted it has half of the collision objects normals flipped, flip them back and check the result, it may look familiar.

Mike Truly
08-21-2009, 09:20 PM
Thanks John... will check it out.

Mike Truly
08-24-2009, 05:25 PM
Finally getting back around to this.

John, thanks very much for your example! I rebuilt the flow based on yours and have it working about the same.

1. One thing that was a bit puzzling... in your example you have the ground plane mesh with half the faces with flipped normals. Mine is working setup the same way. But early on, I tried to use an object with a stack to do the same thing and it didn't seem to work. Stack was like Plane>Mesh Select>Normals but it did not give the desired result as with collapsing to Editable Mesh and flipping the faces. Weird.

2. Other issue I'm having is that there is a bit of a gap on each strike right as the blade approaches the dividing line of the flipped faces (the center of the blade swing). See attached image. Not sure how to get even distribution across this area.

Thanks again.

Piflik
08-24-2009, 05:41 PM
Any particular reason why you're using an UDeflector? A standard deflector should do it. In my experience the Deflector is far more reliable than the UDeflector. Also it works in both direction, while the UDeflector depends on the normals of the mesh.

Mike Truly
08-24-2009, 05:59 PM
Thanks for this info Philipp!

I was using that because that's what John used in his example. I see that a plain deflector does work with both directions of the swing.

But I still have the problem of the gap that occurs mid-swing (as the blade nears vertical).

Thanks again.

Piflik
08-24-2009, 06:13 PM
That one is actually not easy to solve. Since the particles on the blade will move parallel to the ground at the center, no particle will actually hit the deflector. Firstly you can increase the density of particles on the blade to narrow the gap. To get completely rid of it, you might have to use additional deflectors. (I would add small SDeflectors where the gaps are. The spawned particles will be offset from the ground, but if you render your texture from an ortographical camera, this difference will not be visible.)

JohnnyRandom
08-24-2009, 06:30 PM
I noticed that too, I don't know why the select mesh + normals modifier gives that "gradient" type transition with the normals. It is odd.

Yeah, I think your only easy solution in that case is to raise the integration steps at render time, there will always be some gap where the collision normals change but with enough particles and a high enough integration step the effect should be minimal.

EDIT: Just saw the above posts " or just add some more deflectors" ;)

As for Deflector vs. UDeflector reliability that is debatable, especially when using simple geometry, deflectors when not relying on normals sure, but the collision detection is the same.

Mike Truly
08-24-2009, 06:49 PM
OK, if I make another deflector just in the center gap area that is rotated to a slight angle from the main deflector... I can make some filler particles spawn there to fill the gap.

But I need a way to make the particles move to be on the same plane as the original deflector particles. Using a Gravity to try to make all the particles fall onto the same plane results in some particles sticking to a plane... but others fall through ignoring the Collision plane.

Sigh.

JohnnyRandom
08-24-2009, 07:28 PM
You have Box#3, I assume?

Create a simple data operator that adds a few world space units to the Z-axis after spawn.
http://farm3.static.flickr.com/2586/3853365282_90298d5545_o.png
In event 02 add the new data op, your existing force, and a a collision test. Create another Deflector :) or Udeflector with a new ground plane and choose Stop as the speed.

http://farm3.static.flickr.com/2524/3852611321_31f0e62e48_o.png

BTW Upon rethinking, instead of adding more deflectors to the scene, use the Udeflector + Shape I used earlier and simply extrude the edges 1.0 along the normals seam and that will alleviate the seam spawn issue without additional burden.

Mike Truly
08-24-2009, 08:17 PM
Thanks very much John! The Extrude edges trick filled the gap. Actually, I used Extrude Edges on an Editable Poly so I would get a little bit of an angle in this gap area and it filled nicely with no perceptable rise in the particles in this area.

Thanks again.

Mike Truly
08-24-2009, 11:22 PM
OK it's working great... so naturally I want it to do more.

I have set this up based on Allan McKays Procedural Footstep tutorial and it works great but is only giving me a single depth of the gouge (see attached). Ideally, I would like to have the gouge have varying depth.

Any idea how to accomplish this this? I think this is much more complex to accomplish.

Thanks!

JohnnyRandom
08-25-2009, 01:29 AM
A nice arc through, I presume

Hmmm, well I can tell you if you had Box#2 it would be a snap ;) you'd have it done in less than 10 minutes (See Here (http://www.orbaz.com/visualguide/particleflowtools/box2/PSkinner_ChannelPaint.html) watch the final video at the bottom of the page), assuming that you don't though, hmmm... I'll have to think about that.

Not sure about Allans' file I recall seeing it ages ago, is it possible to make the deformation events recursive, ie loop through the deformation events until complete?

grury
08-25-2009, 11:49 AM
Thats how I recently did a snow footstep setup.

Non renderable particles system emiting on the object you want to create the marks.
Use the mesh you want to deform as a deflector, whenever the object touches the deflector it spawns then use a Lock/Bond op to stick the spawned particles to the object you want to deform. Use a Shape op on the Lock/Bond event, Spheres for exemple.
I then used Mesher to create a mesh of the particles on the ground and a Volume Select modifirer on the ground mesh and use Volume select by obj mesh, pick the Mesher.
Use the a Push and Noise modifier to create the marks on the mesh.
The more detail you have on your mesh the better the results, obviously.

Hope it made any sense..just had a 30 hour work marathon, I guess I'm a bit numb in the head :) but when I get back I can put a demo together if you want.

Mike Truly
08-25-2009, 03:43 PM
Thanks for the ideas.

I do have Box2... just don't know how to use it yet. :)

But it seems like there should be another way. Allan's method basically uses the particles>mesher to define where the displacement should be (in 2D with no depth) and an XForm to move the mesh down a fixed amount.

I have found that with multiple UDeflectors at different levels below ground, I can make the particles form an arcing depth (the gap in the middle issue is still a problem).

So if I had a different method of pushing down the verts with variation instead of a XForm (which only pushes down a single amount)... it would work.

Thanks again.

Piflik
08-25-2009, 04:01 PM
You can add additional XForms (put the different 'levels' of your particles in different meshes) to create a stepped profile and then a Relax Modifier to even it out.

Mike Truly
08-25-2009, 04:40 PM
Thanks Philipp! I was already heading down that path but the Relax modifier makes the results look much better.

Thanks again.

PsychoSilence
08-26-2009, 04:56 PM
A nice arc through, I presume

Hmmm, well I can tell you if you had Box#2 it would be a snap ;) you'd have it done in less than 10 minutes (See Here (http://www.orbaz.com/visualguide/particleflowtools/box2/PSkinner_ChannelPaint.html) watch the final video at the bottom of the page), assuming that you don't though, hmmm... I'll have to think about that.

Not sure about Allans' file I recall seeing it ages ago, is it possible to make the deformation events recursive, ie loop through the deformation events until complete?

i SOOO wish we had that particle impact map as procedural material outside of the skinner :(((

how about rendering shape marks in top view reprojecting it and using it as map in a displace modifier? i remember doing that alot back then. Just make sure to NOT use VRay, it still doent understand particle mapping properly to the very day :(

here is the setup something like allanīs:

www.3delicious.de/spielwiese/research/PFlow-MeshDeform.rar
www.3delicious.de/spielwiese/research/PFlow-MeshDeform.avi

kind regards,
Anselm

CGTalk Moderation
08-26-2009, 04:56 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.