Difference between revisions of "Project3W16"

From Immersive Visualization Lab Wiki
Jump to: navigation, search
(Flight Controls)
(Race Track)
Line 15: Line 15:
 
This [http://www.calit2.net/~jschulze/tmp/engineering-campus-obj.zip UCSD campus model] provides the environment for the race track. Load it into your application and turn the buildings and the ground plane into colliders that cannot be traversed.
 
This [http://www.calit2.net/~jschulze/tmp/engineering-campus-obj.zip UCSD campus model] provides the environment for the race track. Load it into your application and turn the buildings and the ground plane into colliders that cannot be traversed.
  
The race track is a 3D line defined by a sequence of points. During the race, the player has to keep the drone within a corridor defined by the line. The drone has to stay within a maximum distance from the line. Make this distance a parameter defined in a single place in your application so that it can be changed later, and start with a value of 30 feet.
+
The race track is a set of check points the player has to go to in a specific order in order to win.
  
24 hours before grading starts, you will get the competition file, which will be an ASCII file in the XYZ file format, listing the points defining your race track. The coordinate system will be that of the campus model. An XYZ file does not have a header, it only consists of a list of point locations in 3D, in the format X Y Z<return>X Y Z<return> etc. An example for an XYZ file defining two points is this:
+
24 hours before grading starts, you will get the competition file, which will be an ASCII file in the XYZ file format, listing the points defining your check points. The coordinate system will be that of the campus model. An XYZ file does not have a header, it only consists of a list of point locations in 3D, in the format X Y Z<return>X Y Z<return> etc. An example for an XYZ file defining two points is this:
  
 
<pre>
 
<pre>
Line 24: Line 24:
 
</pre>
 
</pre>
  
The example defines two points. The points are separated by a line break. On each line are three floating point numbers. The first three are the x, y and z position of the first point. The next three numbers are the x, y and z coordinates of the second point, and so on. There could be thousands of points in the file. In this project you can assume that the competition file will not have more than 10,000 points.
+
The example defines two points. The points are separated by a line break. On each line are three floating point numbers. The first three are the x, y and z position of the first point. The next three numbers are the x, y and z coordinates of the second point, and so on. There could be hundreds of points in the file. In this project you can assume that the competition file will not have more than 100 check points.
  
 
Here is what you need to do:
 
Here is what you need to do:
  
 
* Write a parser for XYZ files. It should be a simple for loop in which you read each line of the file. In C you would use the [http://www.cplusplus.com/reference/cstdio/fscanf/ fscanf] command for this. Your parser does not need to do any error handling - you can assume that you will get a proper XYZ file. You do need to recognize when there are no more points in the file (i.e., check for End of File)
 
* Write a parser for XYZ files. It should be a simple for loop in which you read each line of the file. In C you would use the [http://www.cplusplus.com/reference/cstdio/fscanf/ fscanf] command for this. Your parser does not need to do any error handling - you can assume that you will get a proper XYZ file. You do need to recognize when there are no more points in the file (i.e., check for End of File)
* Draw the race track using a method of your choice. You can assume that the entire track will be floating above the campus model and will not intersect with any buildings. For instance, you can draw a sequence of straight lines that connect the points given in the XYZ file. Or you can use parametric curves to smooth out the turns. Optionally, you can visually indicate the tube around the center line, within which the drone must remain. The tube can be drawn wireframe style, or with translucent or even opaque polygons. The goal is that the visualization should allow the player to move along the race track as fast as possible without deviating from the race track. There will be a time penalty for leaving the race track corridor.
+
* Draw the check points using a method of your choice. You can assume that all check points will be floating above the campus model and will not intersect with any buildings. For instance, you can draw the check points as wireframe shperes. The goal is that the visualization should allow the player to move from one check point to the next as fast as possible without missing any. There will be a time penalty for each check point missed.
  
 
==Aircraft==
 
==Aircraft==

Revision as of 17:29, 1 February 2016

Contents

Air Race

This project is due on February 12th at 2pm and to be demonstrated, as usual, in CSE basement lab 220.

For user input the only permissible device is the Sony Move controller (the extra credit allows an additional 3D device).

Sony Move Setup (10 Points)

To use the controller, you will have to first get its driver to work. There is no official, polished driver available because the device was made for the Playstation. However, we are providing a Windows version of the driver on our MoveInVR wiki page. On the Piazza page is a special note in the pinned area under which you can post questions about the setup.

If you use an Apple computer with OS X these instructions will hopefully get you going with the Move. Please post any problems you run into on the Piazza page and we'll try to help.

Race Track

This UCSD campus model provides the environment for the race track. Load it into your application and turn the buildings and the ground plane into colliders that cannot be traversed.

The race track is a set of check points the player has to go to in a specific order in order to win.

24 hours before grading starts, you will get the competition file, which will be an ASCII file in the XYZ file format, listing the points defining your check points. The coordinate system will be that of the campus model. An XYZ file does not have a header, it only consists of a list of point locations in 3D, in the format X Y Z<return>X Y Z<return> etc. An example for an XYZ file defining two points is this:

-200.0378 100.1279 10.0475
-202.0447 103.1288 10.0905

The example defines two points. The points are separated by a line break. On each line are three floating point numbers. The first three are the x, y and z position of the first point. The next three numbers are the x, y and z coordinates of the second point, and so on. There could be hundreds of points in the file. In this project you can assume that the competition file will not have more than 100 check points.

Here is what you need to do:

  • Write a parser for XYZ files. It should be a simple for loop in which you read each line of the file. In C you would use the fscanf command for this. Your parser does not need to do any error handling - you can assume that you will get a proper XYZ file. You do need to recognize when there are no more points in the file (i.e., check for End of File)
  • Draw the check points using a method of your choice. You can assume that all check points will be floating above the campus model and will not intersect with any buildings. For instance, you can draw the check points as wireframe shperes. The goal is that the visualization should allow the player to move from one check point to the next as fast as possible without missing any. There will be a time penalty for each check point missed.

Aircraft

You are free to choose any 3D model for your aircraft you would like. If you don't find one, feel free to use this Collada model of a quadcopter, provided by Professor Falko Kuester's lab here at UCSD, designed by graduate student Dominique Meyer. Regardless of what drone model you use, for collision checks with buildings and the terrain assume a drone size of a cube 3 feet wide, or a sphere with a diameter of 4 feet. Your flying object does not even have to be a drone, but it should be one that can plausibly fly in any direction, not just forward like an airplane.

Flight Controls

You need to implement two different ways to control the aircraft, both need to exclusively use the Sony Move controller. The first method is given by us, the second is up to you to create.

Method 1: This method utilizes only the 6 DOF (degrees of freedom) position and orientation data from from controller, along with a (binary) button. The idea is that when the button is pressed, the location and orientation the controller is in at that moment is stored in memory. The user will then hold down the button as long as they want to move the drone around. The movement is done by fetching the 6DOF data every frame, and comparing it with the 6DOF data stored initially. The delta between the two, both position and rotation angle, will be multiplied by a fixed calibration factor, and then applied to the drone. When the button is released, the aircraft comes to an immediate stop.

Method 2: This is your custom method. Try to come up with a way that works better for the given scenario, allowing the player to get through the race track faster.

Wayfinding

Extra Credit: Two Player Mode (10 Points)

Create a split screen view of your application to allow another player to control their own drone and compete against one another. The second player needs to use the input device from the first project. Let's find out if the player's speed depends more on skill or on the input device.

[To be completed Monday afternoon]