Keywords: motion

Summary

This demo shows one method for adding moving geometry in to a scene. A car is shown driving across a flat ground plate using a the Delta motion model.

Details

This demo features a car that drives across the scene. The motion for that path and velocity are described using the Delta motion model via a MOV file. The Delta motion model works by describing an initial condition (starting location and orientation) and the providing updates or deltas to the previous state at some set of intervals. Hence, the location at time = tn is based on the location at time = tn-1, which is based on the location at time = tn-2, etc.

Important Files

This section highlights key files important to the simulation.

The car geometry and motion

The geometry of the car is contained in the Alias/Wavefront OBJ file geometry/sedan_red_subaru.obj. This OBJ file is added to the scene in the geometry/sedan_red_subaru.glist file, which includes a single dynamic instance:

    <dynamicinstance>
      <motion type="delta">
        <filename>sedan_red_subaru.mov</filename>
      </motion>
    </dynamicinstance>

This instance setup specifies the delta motion model, which will use the information in the sedan_red_subaru.mov file to locate and orient the car as a function of time. The details of the MOV file is described in detail in the Delta Motion manual.

Setup

Single-Frame Simulation

To run the single-frame simulation, perform the following steps:

  1. Run the DIRSIG demo.sim file

  2. Load the resulting demo-t0000-c0000.img file in the image viewer.

Multi-Frame (Video) Simulation

To run the multi-frame (video) simulation, perform the following steps:

  1. Run the DIRSIG demo.sim file

  2. Load the resulting demo-t0000-c0000.img, demo-t0000-c0001.img, etc. files in the image viewer.

The make_pngs.csh C-Shell script can be used on the UNIX and Mac platforms to make a set of PNG images for encoding into a video.

Results

Single-Frame Simulation

The single-frame simulation generates a single output image

images/demo.png
Figure 1. Output of the single-frame (static) simulation.

Multi-Frame (Video) Simulation

The multi-frame simulation will generate a series of output images, each 0.5 seconds apart. They show a car driving along the path defined in the movement description.

images/video.gif
Figure 2. Animation of the car driving the path described in the MOV file.
Note
The motion description was created by hand and the orientation of the vehicle was approximated. Hence, the vehicle does not appear to be pointed in the direction of travel. This is not a limitation of DIRSIG itself but of the fidelity of the input motion description.