Getting Started

Prerequisites

  1. Currently, MGView requires WebGL in Google Chrome. Firefox may work, but it is not officially supported.
  2. To check that your Chrome installation supports WebGL:
    • Launch Chrome and visit the examples page.
    • Click on the first example, "Classic Particle Pendulum."
    • Ensure that the pendulum model appears, and runs when you click the green timer button on the top bar. Note: If you see a red background in the visualizer and you are sure that you are using Chrome (not Safari, Firefox, or Internet Explorer), then your physical hardware may not support WebGL.

Installation (only needs to be done once)

Running

Creating Numerical Pose Data Using MotionGenesis (MG)

Your MG simulations must output animation data (position/orientation vs. time) for each point and frame that you want to visualize.
  1. Ensure you have defined the position of each "origin" point in your simulation (No, Bo, etc).
    Note: The   Translate command is sufficient, you do not need a separate   SetPosition call.
  2. Ensure the time step set by the MG command
    Input IntegStp = 0.01
    provides a reasonable visual frame-rate without making data files excessively large.
  3. Ensure the line   Animate(N, No) appears in your MG command file before the MG command   ODE() myFileName
    In the Animate command:
    • Replace "N" with the name of your NewtonianFrame.
    • Replace "No" with the name of your World Origin.
    • By default it will animate everything. You can optionally specify which
      points and bodies to animate, e.g.   Animate(N, No, A, B, C, Ab, Bc).
  4. After running the simulation, you will have a series of data files called "myFileName.1", "myFileName.2", etc.
  5. See the samples in in your MotionGenesis/MGView/samples folder if you have trouble.

Creating the JSON file for MGView

Visualizer files use the JSON format.
  1. Copy the file default.json into the folder that contains your motion data files.
  2. Rename "default.json" to "myFileName.json"
  3. Edit "myFileName.json" for your data, as described in the section "JSON File Contents" below.

Loading Simulations

  1. Follow the "Running" instructions above to open an MGView window.
    Note: If the HTTP Server is already running and you want to just open a new MGView tab in Chrome,
    you can type:   localhost:8000/MGView/MGView.html in the Chrome address bar.
  2. In the text field in the upper-left corner, type the relative path to the json file from the MGView.html file.
  3. Click the "Load" button.

Hint: If things don't seem to be working, hit Ctrl+Shift+j to open the javascript developer tools window.
Select the "console" tab, which displays status messages. Errors (such as file not found) are displayed in RED.

Adding Visual Geometry Using the MGView GUI

The MGView GUI provides point-and-click functionality to add visual geometry to the points and frames in your simulation.
For the purpose of visualization, we will call these "objects."

After loading your .json file in the MGView tab in Chrome, you can add various kinds of geometry. For all types, the basic procedure is:
  1. Click on the name of the object in the "Objects" list on the left side.
  2. In the "create new" text box, type a name for the geometry (e.g. "myGeometry") and click the "+" button.
  3. In the "Geometry" pull-down box, select the desired type (sphere, cylinder, mesh, etc).
  4. Specific dimensions for each geometry type can be controlled using the spinner boxes that appear.
Geometry Types

JSON File Contents Note: JSON file content is case-sensitive.

Certain fields in the JSON file must be edited by hand.
Required fields to edit: Additional fields: Advanced usage:
This is a footer!