Jump to content
mois23

How create a constraint network for simulating Car Suspensions?

Recommended Posts

On 15/10/2019 at 6:00 AM, julian johnson said:

Hi K'n'K, glad you liked it. I'm in the middle of a job at the moment so I can only give you brief pointers. You are right, though, I think it can all be done in the distance travelled CHOP. For reverse you need to establish some concept of what constitutes forwards and what constitutes reverse. I think using the tangents of the path curve and bringing them into CHOPs would be the way to do that - then compare the slope vector with the tangent vector. A dot product between the two would give less than 0 for reverse and greater than zero for forwards. Then just multiply the result of the area chop (length) by -1 to negate if you want to reverse (using the dot product to tell you whether you need to). For wheelspin I think a simple animated add to the length chop would do (for a manual spin) or using the acceleration to procedurally increase the length if it goes over a certain threshold. CHOPs are fiddly so it might take a few tries to get it right!

Thanks man but I noticed if I change the keyframe on "animation_along_path" from 1  - 240 to something else, say 200 - 440. The wheel doesnt spin as soon as it gets past frame 240.

How would I go ahead to make the wheel spin if I extended the animation past frame 240?

Edited by Learna
Correction of path name

Share this post


Link to post
Share on other sites
On 19/10/2019 at 6:49 PM, K'n'K said:

Oh nice. A simple math node with an animated "post add" works fine for wheelspins and braking. Thanks!

Please, can you guide me on how to change the start and end frame of the simulation? If I change the key frames available on the "animation_along_path" node from 1 - 240, to say 200 - 440, the wheel doesn't spin as soon as it gets to 240.

Share this post


Link to post
Share on other sites

Have a look in here. All I've changed is the animation along the path, the time start/end in the fetch node in the distance travelled chop and I've had to kludge the constraint on the steering object to work past frame 240 by hard setting the sample rate....

car_rig_bullet_julian_offset.hipnc

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
On 9/17/2019 at 7:13 AM, julian johnson said:

It's been a while (!) but here's an interim development of the original double wishbone chassis concept. Now you can fully adjust chassis to match car - it's all done via names - so you can transform the model in any way you like (just don't change the point numbering as constraint naming is based on point numbers). Effectively bullet is used to make the constraints easy and the only real simulation is on the wishbone springs. Wheels are pre-animated along a path and then adjusted for roll, ackerman steering angle (inner and outer wheels at different angles). Still quite tricky to adjust the sim because mass, spring strength/damping, load transfer and conetwist maximum angles are all interrelated - change one and you need to change all the others! This test Porsche is overly springy to illustrate the basic concepts at work especially the load transfer forward to back. Needs more work on rest to action transition period, too! To change the car simply bring the new car and wheels into the chassis node and swap out, make sure to transform chassis geo to fit. Change path, collision ground as you see fit....

soft2.gif

car_rig_bullet_julian.hip

Hey Julian! This is awesome! Trying to mess around with it right now, but I'm in H18 not sure if that matters and the car does not seem to want to follow the path, The sim works fine and suspension works but all it apears to do is pop up on top of the geometry and kinda wiggle for a sec, am i just an idiot missing something basic? 

Share this post


Link to post
Share on other sites

Yeah, I confirmed the file does not work properly for H18. I guess CHOP nodes are something changed....

Share this post


Link to post
Share on other sites

It seems to work in all versions of 18.0.x up until 18.0.499. Up until then, somehow, the Transform Pieces node could apply non-named template attributes from a single point to all four wheel points. In 18.0.499 the points have to be matched by a name attribute for it to work. Possibly SideFX have fixed a long-standing bug or broken a normal piece of functionality. No idea which :-)

 

car_rig_bullet_julian_18.0.499.hip

Edited by julian johnson
  • Like 8

Share this post


Link to post
Share on other sites

Dear all. I tried to understand how you created this rig but for someone without any knowledge what quaternions are or how to code it's out of reach. Therefore I'd like to ask you if the final result could created without coding? Just by wiring together nodes?

Share this post


Link to post
Share on other sites

Does anybody know why Julian's set up works in 17.5 but breaks in 18?

Edit: Julian has answered this above and posted an updated scene file with the points matched by a name attribute

 

Edited by Stotty

Share this post


Link to post
Share on other sites
On 8/13/2018 at 9:51 PM, mois23 said:

I tried with this solution (please find hip file attached) but spring constraint doesn't work. Can't figure out why. :(

Here the .abc file I'm using. Anyone can help?

 

Car Destruction v04.hip

can you share the abc

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×