3dmax question : how to make an object animate on collision?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  08 August 2009
3dmax question : how to make an object animate on collision?


I have an animation of a rotating box, and a wall of 100 of such boxes.

The thing i want to do is to achieve an effect of each box playing its animation on collision with some other object or deflector that i would animate to move through my wall of boxes. Everywhere that i would move my trigger object/deflector, the box that would be in contact with it would animate.

I though about using a proxy, but i dont know how to trigger it's animation on collision... maybe i should set some particle flow structure? or use maxscript? I have some knowledge about particle flow, so just giving me a hint to set me on a good thinking path would be great. Thanks in advance.
  08 August 2009
Shure you can do that woth PFlow.

Have a look here on how to use existing geometry as particle shape.
All you'll have to do is adding a collision test beneath the script operator and send the particles to a new event with a spin operator. (there surely is a way to use the existing animation via a script operator, but this way is easier )
  08 August 2009
Spin does not give me the control i need, i need to be able to play the animation of the object on collision becouse it's more complicated. Such information would be helpful for other things, for example what about a case where i have a morphing box (morph modifier) and i want it to animate from 1 to 100% on collision with some object?

it's really tricky, i will try to find what i need in scripting.

Thanks for the quick reply.
  08 August 2009
Thought about it some more and I think it might be possible to do this without a script (you'll still need the first one, but remove the 'shape' lines).

In the first event you'll put a shape instance operator and use your animated box as source (leave 'animated shape' unticked). Then replace the collision test with a collision spawn test (you'll need to reset the particle age) and in the next event put another shape instance operator, this time with 'animated shape' on and sync by particle age.
  08 August 2009
Great idea, i tried to test it, but i cant get the shape to animate at all... here's the screen, my shape instanced particle wont animate though everything is set up fine (checked with 3dmax's help).

large image:

  08 August 2009
hi Piotrek, using the 'animated shape' option should work for your previous example of the morph target, but it appears that your picture is using your first example of spinning the whole box. The way I understand it, the particle system looks for vertex animation, not transform animation. If you want to use the animation of the box spinning do it with a XForm modifier - that way the pivot of the object is not actually animated but the vertices are instead, so PFlow should be able to use it. Hope that helps
  08 August 2009
Hi, with the xform modifier particle flow reads animation, and the box animates with transform keys, but unfortunately not as i would expect :(. It's hard to explain, but for sure you cant animate that way and get good results.

msmith81: Thanks for explaining to me how the animate shape works, i didnt knew it only works on vertices and i read the description in the 3dmax help... I will do my particle animation on a lot of morphs, i did some tests and the results are very promising

Piflik: is there some particle flow scripting guide available? where can i learn the basics of particle flow scripting?
  08 August 2009
Bobo has some scripting examples on his website, but they're quite old...beside that he has published two PFlow Scripting DVDs, availible on CGAcademy.

Allan McKay also has some basic tutorials on PFlow scripting, but aparently it is impossible to download from his website at the moment...

Of course the first step would be the MaxScript User Reference
  08 August 2009
No no no! No scripting required

Click your box, goto "Group"-->"Group" (ie, group the box to itself)

Now, select that new group as your shape instance object.

All transforms keys will now count towards particle animation

You can do this with multiple objects as well (ie, if you need a bunch of animated objects to be instanced by particles).
  08 August 2009
WOW, thank you so much! It's so simple now! I understand that the GROUP stays still and 3dmax reads the vertex information inside the group, that's why you can animate the box or any other grouped object. As long as it stays inside a group, particle flow will read it's vertex position, awesome!

thanks again!
  08 August 2009
It can simply be done in pflow without groups and using an x-form mod on your box and animating that rotating.

pflow wont take into account objects transforming in world space, only deformations. As long as you got it set up all right, but its really simple to do in pflow.
  08 August 2009
Originally Posted by JonathanFreisler: It can simply be done in pflow without groups and using an x-form mod on your box and animating that rotating.

That's easier said than done. What happens when you've got a whole character rig that needs to be instanced in particles. Let's say, a little walking robot (that has no deformations, just transformation animations). Should you go and rig/animate the whole thing with x-form modifiers?

Seriously....grouping an object to itself, or making a group out of multiple objects is a million times easier and simpler to manage
  08 August 2009
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:44 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.