Animated Campus Vehicles: Difference between revisions

From CS486wiki
Jump to navigationJump to search
Content deleted Content added
Core (talk | contribs)
No edit summary   (change visibility)
Core (talk | contribs)
No edit summary   (change visibility)
Line 7: Line 7:


- Build a program or script to have the vehicle follow a given path
- Build a program or script to have the vehicle follow a given path
==General Solution==
The general solution can be called the Hansel and Gretel approach. The path that the vehicle will follow is layed out using a set of
objects called "way markers" (bread crumbs). The way markers are consecutively numbered to give an ordering to the path to be followed. The way markers are placed at ground level on typically a campus roadway, the vehicle seeks out the starting way marker
and then moves from that way marker to the next higher numbered way marker. This continues until it reaches the last way marker and then it moves to the first way marker and continues (for ever).
==EZScript Usage==
==EZScript Usage==
===Our Implementation===
===Our Implementation===

Revision as of 19:59, 15 May 2012

This page describes how EZScript was used to animate campus vehicles


Project Description

The Animated Campus Vehicles project is a subproject of the Virtual BU project. This project's goals were to:

- Create a campus maintenance vehicle (Humvee golf cart)

- Build a program or script to have the vehicle follow a given path

General Solution

The general solution can be called the Hansel and Gretel approach. The path that the vehicle will follow is layed out using a set of objects called "way markers" (bread crumbs). The way markers are consecutively numbered to give an ordering to the path to be followed. The way markers are placed at ground level on typically a campus roadway, the vehicle seeks out the starting way marker and then moves from that way marker to the next higher numbered way marker. This continues until it reaches the last way marker and then it moves to the first way marker and continues (for ever).

EZScript Usage

Our Implementation

The EZScript module is responsible for the vehicle movements within the world. EZScript cell-scripting allows for a JavaScript based script file to be executed on a cell. More documentation can be found here. For this motion to function, the vehicle which is being moved must have the motion module attached to it and all way point objects must have EZScrpit enabled so that they can be interacted with using commands from the vehicle. It is further essential that the latest version of EZScript build be used which can be accessed from the googlecode repository.

To create a path the user must place down a series of objects in the world and name them given a the scheme <Group_Name>-<WayPoint_Number>. WayPoint Numbers also start at 1 and not 0 (as would be conventional for an array). Using this scheme one can use basic string concatenation and a loop to iterate through all of the way points in a given group.

Where to download

Professor Steflik has been given a copy of EZScript compatible with the script written. However, openwonderland can be checked out via subversion from googlecode and built on linux using ant. Instructions can be found here.

Future Development

If this project is to be continued in the future, make note that Jagwire has added EZScript functionality very recently (see rotate and GetCellRotation) that will help aid the addition of a smoother motion around corners. Unfortunately, these updates weren't pushed to subversion in time to make the stable final script.

Vehicle Development

The Binghamton University maintenance vehicle was developed using Google SketchUp 8. The basis for this vehicle is a military humvee which was then stripped down and rebuilt to resemble one of the maintenance vehicles. Some changes include remodeling the rear axle and addition of a drop in trunk, remodeled front axle and front end, new color to both interior and exterior model faces and addition of transparent windows to the model. The vehicle was oriented in Sketchup such that positive motion on the Z-axis in OpenWonderland represents the vehicle driving straight (when there is no rotation on the Y-axis).

Bugs/Fixes

Bug found with EZScript when using the EZScript function GetCellRotation when used at a high rate. Jagwire, the creator of EZScript, continuously fixes and updates EZScript. All bugs and possible fixes we found have been reported to him.