Blog | Practice with Path Animations | Part 1
The path animation tool is a great way to create fast visual aids for your case without the need to optimize a simulation scenario. Using the path animation feature, vehicles paths and kinematic sequences are predetermined without using the time-forward kinetic simulator. In this post, we’ll review some of the features and functionality of the path animation tool.
Our objectives in this exercise are:
- Use the path animation feature in backward time evaluation
- Set up an animation of a decelerating vehicle traveling in a straight-line
- Set up an animation of a decelerating vehicle that is also turning
- Study simulated vehicle motion to help fine-tune the look of an animated vehicle’s key orientations
First, let’s start by inserting a pickup truck into the scene.
Using the path animation tool, create an animation path for the truck.
The default settings (“evaluate:backward”) of the path animation tool are such that the animation sequences progress forward in time as you read down the sequences list, but the progression of speed as a function of distance along the path is evaluated backward assuming first that the vehicle eventually goes to rest. We'll review forward-time evaluation in our next post. The default sequences one sees after first creating an animation path are: reaction (uniform motion), deceleration, zero, instant speed change, and finally deceleration. The sequences can be modified however needed depending on the case.
Left-click and drag to highlight all of the sequences.
Next left-click on “remove sequence” to delete all sequence entries. You should now see the vehicle at rest.
Next, and this is important, set the spring effect option in the sequences menu to 0%. We will return to this later.
Now, left-click on “add sequence”. This will automatically place a deceleration sequence entry into the animation sequence list. Change the brake lag to 0 seconds. Let’s suppose we’ve concluded that the vehicle in our subject case was decelerating at an average rate of 0.5 g over 100 feet. Let’s animate this using the path animation tool. Input 100 ft for the distance entry and 16.087 ft/s^2 for acceleration.
Because our animation is in backward-time evaluation mode, the initial speed at the start of the animation is automatically calculated. Notice the initial speed shown at the start of the animation path is 38.674 mph. This is the initial speed expected, given a final speed of 0 mph, a stopping distance of 100 ft, and a deceleration rate of 0.5 g.
Note the distance offset parameter is 65.617 ft for the template sequence entries. This corresponds to the distance from the first control vertex of the animation path to the “zero” point sequence entry. Since we deleted the zero sequence entry, this offset is simply the distance between the first control vertex of the path and where the animated motion will actually begin.
Let’s go ahead and set the offset to 0. Now you’ll see the animated motion start from the first control vertex.
Notice, as you play your animation, the pitch angle of the truck doesn’t change. This causes the animation to appear stiff and a bit unnatural. We can improve the look of the animation by including a dynamic pitch angle as a function of travel distance. We’ll do this by first making some observations of how the pitch angle should behave, by studying a simulation.
Let’s insert another instance of our vehicle (blue truck). This time we’re going to simulate its motion. Let’s give our simulated truck an initial speed of 38.674 mph. Let’s also place a deceleration entry into its sequence menu. Set the brake lag to 0 and the deceleration rate to 16.087 ft/s^2. Since we snapped the initial control vertex of our animation path to (0,0), it’s easy to ensure both trucks start at x=0. Since we’re comparing the results of a time-forward kinetic simulation to a backward-time evaluated closed-form calculation, we minimized the integration time-step size in the simulation menu, to ensure the time-step size itself didn’t cause large differences.
Here we see the two in motion side by side:
Here we see the total distance traveled as a function of time. The two curves overlay each other, illustrating excellent agreement.
Next, we see comparing cg positions versus time in the report, the vehicle positions agree to within a fraction of an inch. Note, the animated vehicle’s total travel distance is 100 feet by construction as that is the input value in the animation deceleration sequence entry.
When comparing in side profile view, notice the animated truck does not change pitch angle. This is because we set the spring effect value to 0%. The spring effect allows the vehicle to couple to the pulley-like path animation node using a damped-spring joint. The effect of the joint-spring is to give the vehicle some pitch and roll freedom, which gives a natural look and feel to the animated motion. We can also simply define the yaw, pitch, and roll angles of the vehicle along the animation path by hand. Virtual CRASH will interpolate these angles between interpositions where key values are defined.
Explicitly specifying pitch angles
Open the interpositions menu for the path animation object. Also, switch to interpositions selection mode. You can control the position of your interposition either by using the yellow dot control grip, or by simply specifying the distance entry in the interpositions menu. You should see the yellow dot appear when you hover your mouse over the animation path, but only after you’ve switched to interpositions selection mode. In this case, we’ll set the distance of our first interposition to 0 ft. This distance value is the distance with respect to the animation path’s first control vertex. Press “add interposition” then set distance to 0 ft. Now we have a single key orientation (yaw = 0, pitch = 0, roll = 0) set at a distance of 0 ft from the start of the animation path. This orientation will propagate forward for the full animation path.
From the data report above, we know at this deceleration rate, we should expect our truck to pitch forward about 1 degree. So, set the pitch angle for the interposition to 1 degree. The pitch should now be 1 degree for the full animation path. In side orthographic view, we see good agreement between the simulated and animate truck orientations.
At the end of the simulation however, the simulated (blue) pickup returns back to static equilibrium, with pitch = 0 degrees, but our animated (red) truck still has pitch = 1 degree.
Add two more interpositions into the interpositions menu. Set the second interposition at a distance of 99 ft. Remember, this is the distance from the first control vertex of the animation path. Set the pitch for this second interposition to 1 degree. Virtual CRASH will now interpolate between the first and second interposition, keeping the pitch angle 1 degree. Put the third interposition at 100 ft, and set the pitch to 0 degrees.
Now as the pickup moves from interposition 2 to interposition 3, the pitch angle will gradually change from 1 degree to 0 degrees.
As the animated vehicle comes to rest, you should see the pitch angle return back to 0 degrees. Select the animated vehicle object itself, and input a braking sequence entry so that the wheel rotation rate reduces. Note, steering, braking, or acceleration sequence entries have no effect on an animated vehicle’s motion, but allow one to control wheel rotation rates and steering angles, which can help improve the look and feel of an animation.
Let’s look at a graph of the pitch versus distance traveled for the animated and simulated vehicles. Note, the “use parent color” option is used so that the graph line colors are the same as the vehicle’s.
From this graph, we see that the simulated vehicle gradually transitions from 0 degrees to around 1 degree of pitch over about 20 feet of travel distance (or 0.4 seconds) as the tire forces cause torque about the pitch axis (y-axis).
Using the simulated vehicle pitch versus distance graph as guidance, let’s add a new interposition in the animation path in order to better capture the gradual increase in pitch at the start of our vehicle motion. Let’s also fine-tune the maximum pitch angle at interpositions 2 and 4 to 0.96 degrees to better match the average behavior of the simulated vehicle. Here we’ll adjust the distance input of interposition 4 to be 16.719 feet to better match the simulation graph. The order of the interpositions doesn’t matter, as the interposition data is evaluated as a function of distance traveled along the animation path. Note the linear interpolation between interpositions illustrated by the graph - the path animation tool linearly interpolates yaw, pitch, and roll values between all interpositions. Now we see our animated vehicle’s pitch versus distance graph (red) roughly sitting over the simulated vehicle’s (blue). Remember, it doesn’t have to perfectly match. We’re only studying the simulated curve behavior for guidance in order to create a more realistic looking animation.
Here we see an animation of the simulated (blue) and animated vehicle (red) motion.
Adjusting both Pitch and Roll
Suppose we have a case were a vehicle makes a sudden avoidance maneuver to the left, while, according to our analysis, also braking at 0.5 g. In such a case, you might draw your animation path over measured tire mark evidence from your crash scene.
Let’s practice adding some roll angle to our animated vehicle motion for this case. Import and scale this diagram to follow along with the exercise. Don’t delete the previous animation path or modify any of the interpositions. Just modify the previous animation path control vertices to overlap with the diagram below.
In this case, we use the arc tool to help draw the animated trajectory, with radius = 125 ft. Clone the arc and use the clone as an auto-driver path (look ahead time = 0.7 seconds) for the simulated vehicle. Using the simulator, we can simulate the left-turn motion of our vehicle to help give us more realistic constraints to apply to our animated vehicle motion.
Again, studying the simulated vehicle behavior can helps us help fine-tune the path animation. Often, you may find it useful to simulate small portions of the animation path for this purpose. First, let’s fine-tune the roll angle. From the roll angle versus distance graph for our simulated vehicle, we see the maximum roll angle occurs at about 40 feet after the start of the simulation, and the maximum roll angle is about 6.4 degrees.
Let’s use this as our reference value for our animated vehicle. Enter a new interposition in the animation path at distance 64.8 ft. Set the roll to 5.5 deg, and remember you’ll need to set the pitch to 0.96 deg since interposition 5 is between interposition 1 and 2.
Now, let’s clean up the roll motion. Re-select interposition 4. Recall interposition 4 begins about 16 feet after the start of the animation. Adjust the roll angle of interposition 4 so that it better matches the simulated behavior. Here we set the roll angle to 2.5 degrees.
Let’s make three more improvements to the roll angle.
Add interposition 6 and set it at a distance of 6.562 ft with a roll angle of 0 degrees.
Add interposition 7 and set it at a distance of 86.970 ft with a roll angle of 0 degrees.
Add interposition 8 and set it at a distance of 55.55 ft with a roll angle of 5.8 degrees.
You can add as many interpositions as you need, but remember, we just want to fine-tune our animation to give it a more realistic look and feel.
Finally, let’s correct the yaw angle. Notice that the simulated vehicle exhibits some side slip as it makes its way around its trajectory. Selecting each of the previously made interpositions, adjust the yaw angle to better match the behavior shown in the simulated curve. A ninth interposition was inserted at 24.11 ft. To input this new interposition, we first switched to the interpositions selection type of the path animation tool. One then hovers the mouse over the animation path, and an interposition control group appears. Simply use the x, y, or z rotation grip to adjust one of the angles, and the interposition is automatically entered into the menu. The benefit of this approach is that the new interposition uses the interpolated yaw, pitch, and roll values to automatically populate the yaw, pitch, and roll input values. This is helpful since using the add interposition feature (rather than the direct mouse hover over option) automatically inputs yaw, pitch, and roll are all 0 deg. We input a tenth interposition at 71.811 ft to futher refine the yaw motion.
Here we see the side by side comparison of the animated versus simulated vehicle motion.
Spring Effect
Finally, return to spring effect in the sequences menu. Set spring effect to 100%. Let’s look again at the roll versus distance graphs. Notice now we see much smoother behavior in the animated vehicle graph. This is because the enabling the spring effect allows a non-rigid, damped-spring-like, joint connection between the animated vehicle and the animation node. The animation node (blue dot) acts as a pulley, forcing the vehicle model to move along the animation path. The effect of this joint connection is to allow gradual and smooth transitions in orientation over time.
Below we see our roll versus distance graph after making some adjustment to our roll values.
In many cases, you may find it’s sufficient to simply enable the spring effect without manually setting any yaw, pitch, or roll values by hand.
Another consequence of the non-rigid coupling when spring effect is enabled, is that as the animation node pulley moves forward, there can be a delay in the motion of the vehicle object, as the vehicle is gradually accelerated forward via the spring-coupling force. This can be seen in the speed versus distance graph. Here we see the simulated vehicle starts at 38.674 mph at the start of its motion, whereas the animated vehicle gradually increases speed over about 300 milliseconds, starting from 0 mph.
With spring effect set to 0% however, we see that the animated vehicle’s speed instantly changes to 38.674 mph.
In general, the spring effect option will cause gradual transitions in acceleration values set by the path animation sequences, whereas setting spring effect to 0% will result in abrupt and instantaneous acceleration transitions as the animated vehicle moves from one sequence entry to the next. As always, one should examine the graph and report data to ensure that animated motion is within acceptable tolerances for the particular use case. Whether you use the spring effect option or not, you can fine-tune and perfect your animation to look as realistic as a simulation.