Difference between revisions of "Project1W16"
(→Unity 3D) |
Dnuernberger (Talk | contribs) (→Extra Credit (10 Points)) |
||
(19 intermediate revisions by 2 users not shown) | |||
Line 23: | Line 23: | ||
Unity 3D comes with a built-in physics engine, it's called PhysX. | Unity 3D comes with a built-in physics engine, it's called PhysX. | ||
− | Note that if you use Unity you aren't allowed to use any Unity assets other than 3D models without explicit permission by one of the course staff. | + | Note that if you use Unity you aren't allowed to use any Unity assets other than 3D models and textures without explicit permission by one of the course staff. |
==The Project (100 Points)== | ==The Project (100 Points)== | ||
Line 30: | Line 30: | ||
* A ground plane nothing can fall through. (10 points) | * A ground plane nothing can fall through. (10 points) | ||
− | * A wall of bricks, | + | * A wall of bricks, generated from code. This can be composited of simple [https://www.opengl.org/documentation/specs/glut/spec3/node82.html glutSolidCube]s or boxes. Use as many bricks as your computer can render at 30 frames per second (you can manually tweak this number). In Bullet, the cubes can be simulated as [http://bulletphysics.org/Bullet/BulletFull/classbtBoxShape.html btBoxShape]. In Unity, you should create a brick prefab and instantiate the wall using instances of that prefab. The bricks must have physics properties applied to them. (20 points) |
− | * A tornado: you can model it as a vertical cylinder, but are free to use a different shape such as a cone. Initially the tornado should be far enough from the wall to not affect it. ( | + | * A tornado: you can model it as a vertical cylinder, but are free to use a different shape such as a cone. Initially the tornado should be far enough from the wall to not affect it. (10 points) |
− | * Add the ability to control the tornado to move it around with the mouse. Allow the user to click on a place on the ground plane and then move the tornado to this point slowly. ( | + | * Add the ability to control the tornado to move it around with the mouse. Allow the user to click on a place on the ground plane and then move the tornado to this point slowly. (10 points) |
− | * When the tornado hits a brick it should | + | * The camera should automatically always follow the tornado. (10 points) |
− | * The simulation should run until the space bar is pressed, at which point it should get reset to the initial state with an intact wall. ( | + | * When the tornado hits a brick it should do something with it. For instance, act like a solid wooden cylinder and apply a force to the brick, or move the brick tangentially to the tornado's surface, or make the brick stick to the tornado. Or you can come up with a more realistic tornado behavior, but that is optional. (30 points) |
+ | * The simulation should run until the space bar is pressed, at which point it should get reset to the initial state with an intact wall. (10 points) | ||
− | Let these images inspire you | + | Let these images inspire you: |
+ | [[Image:tornado.png | 300px]] | ||
[[Image:wall.png | 300px]] | [[Image:wall.png | 300px]] | ||
==Extra Credit (10 Points)== | ==Extra Credit (10 Points)== | ||
− | + | To get the extra credit, you need to replace the ground plane with a [http://www.calit2.net/~jschulze/tmp/engineering-campus-obj.zip model of the UCSD campus], and the brick wall with the buildings on the campus (you may leave the brick wall in the scene in addition to the buildings, if you wish). The tornado should pick up the buildings and toss them around, for which you need to implement something that is a bit more realistic than the simple behaviors expected for the brick wall. This OBJ file provides the campus model. Each building is an individual mesh. In Unity, to make the tornado work, you need to add colliders to the buildings so that they can be recognized by the tornado. You can do this by selecting all of the buildings and adding a capsule collider as well a rigidbody to all of them. | |
− | + | ||
− | + |
Latest revision as of 16:02, 8 January 2016
Contents |
Homework Assignment 1: Tornado
For this assignment you can obtain 100 points, plus up to 10 points of extra credit.
The goal of this assignment is to create an application which uses the physics engine to simulate a tornado hitting a brick wall.
This assignment is due on Friday, January 15th at 2:00pm.
The assignment is to be done in teams of two.
We are offering a homework discussion in WLH 2204 on 'Monday, January 11th at 6pm.
You can choose to do this project in C++ with OpenGL and optionally OpenSceneGraph, or Unity 3D.
C++
To add physics effects, you should use the Bullet Physics Library. This library allows assigning physical properties such as weight and softness to geometrical objects. Then the physics engine will calculate the objects' motion, applying the laws of physics.
Here is an excellent tutorial on the Bullet Engine.
Unity 3D
Unity 3D comes with a built-in physics engine, it's called PhysX.
Note that if you use Unity you aren't allowed to use any Unity assets other than 3D models and textures without explicit permission by one of the course staff.
The Project (100 Points)
Create an interactive application, in which the user can control a tornado with the mouse and destroy a brick wall with it. You will get points for the following things:
- A ground plane nothing can fall through. (10 points)
- A wall of bricks, generated from code. This can be composited of simple glutSolidCubes or boxes. Use as many bricks as your computer can render at 30 frames per second (you can manually tweak this number). In Bullet, the cubes can be simulated as btBoxShape. In Unity, you should create a brick prefab and instantiate the wall using instances of that prefab. The bricks must have physics properties applied to them. (20 points)
- A tornado: you can model it as a vertical cylinder, but are free to use a different shape such as a cone. Initially the tornado should be far enough from the wall to not affect it. (10 points)
- Add the ability to control the tornado to move it around with the mouse. Allow the user to click on a place on the ground plane and then move the tornado to this point slowly. (10 points)
- The camera should automatically always follow the tornado. (10 points)
- When the tornado hits a brick it should do something with it. For instance, act like a solid wooden cylinder and apply a force to the brick, or move the brick tangentially to the tornado's surface, or make the brick stick to the tornado. Or you can come up with a more realistic tornado behavior, but that is optional. (30 points)
- The simulation should run until the space bar is pressed, at which point it should get reset to the initial state with an intact wall. (10 points)
Let these images inspire you:
Extra Credit (10 Points)
To get the extra credit, you need to replace the ground plane with a model of the UCSD campus, and the brick wall with the buildings on the campus (you may leave the brick wall in the scene in addition to the buildings, if you wish). The tornado should pick up the buildings and toss them around, for which you need to implement something that is a bit more realistic than the simple behaviors expected for the brick wall. This OBJ file provides the campus model. Each building is an individual mesh. In Unity, to make the tornado work, you need to add colliders to the buildings so that they can be recognized by the tornado. You can do this by selecting all of the buildings and adding a capsule collider as well a rigidbody to all of them.