Class 9: Matchbox Car Move
- Elizabeth House
- Feb 2, 2022
- 2 min read
I started experimenting with the matchbox car and the race track a few classes ago using the RBD Hinge constraint, but I decided to abandon that in favor for a more CPU-friendly version of a hinged lever using object transforms. Since I already had keyframes for the lever the car was on, I used those and created a static object out of the lever. Inside of my DOP network, I checked on Create Active Object and Use Deforming Geometry. This keeps the keyframes from the lever and allows it to interact with the matchbox car's RBD packed object.

I also wanted to model the race track inside of Houdini, but was having some troubles getting a smooth and flat surface for the car to roll on, so I used NURBs within Maya and extruded for thickness and exported as an .obj file to use as a static object.

Running the RBD simulation with the lever took a lot of testing/trial and error. I was getting some weird behavior with the track itself, as the car would run along it and consequently fall off the edge as if the track was just a surface and didn't have guard rails. I changed the geometry type within the track's static object node to concave and also lowered the collision padding since I'm working as close to real world scale as I can (Houdini is in meters), and the car sat within and recognized the track's guard rails.

While this helped, the car was either bouncing off the guard rail and off the track or would flip as it went around the curve and would slide down the track. I did adjust the car and track's physical properties such as bounce, friction, and mass to aid this, but it was still happening. I assumed it was because the car was accelerating too much going down the initial slope of the track and the momentum was enough force to make it bounce out of its 'racing' shape once it hit the guard rail. So I added a drag node and adjusted the scale force and torque so that the car wouldn't accelerate as quickly.

This did help a lot. However, at its current state, the matchbox car is doing a railslide on the track for a bit. It eventually self adjusts (and is honestly kind of gnarly and sick) but I would like to smooth this out. I'd also like to figure out how to get the tires within the packed RBD to rotate as they would with a real matchbox car, since some of my current camera move shows that off.
The sphere and box that the matchbox car hits at the end are placeholders for the marbles that are going to bounce/roll down the stairs and knock off the Lego figures. At the moment, I haven't added the environment from the class 8 blog post, but I do have the stairs and railing modeled, so the next step really is integrating that and getting the marbles to flow with the current simulation. I do also plan on remodeling the catapult/ball into something less ugly.

Comments