Project4F20

From Immersive Visualization Lab Wiki
Revision as of 19:18, 24 November 2020 by Jschulze (Talk | contribs)

Jump to: navigation, search

Contents

Project 4: Among Us in 167

In this project you will need to build a 3D scene that resembles the activity in the lobby of the popular game Among Us. The lobby, a.k.a. waiting room, is where all players (astronauts) gather before the game starts.

If you are not familiar with Among Us, we recommend that you watch this video clip, which shows a typical game play. Importantly, the first minute of it shows the action in the lobby where the astronauts gather before the game begins.

This video has more active astronauts who keep walking around, which is similar to what you need to simulate for this homework project.

Here is a screen shot of the scenario we are going to mimic in 3D:

Amongus-lobby-snapshot.png

This project implements the following skills from the lectures:

  • toon shading
  • collisions with bounding spheres (when walking around)
  • particle system (when astronauts arrive or leave)

The total score for this project is 100 points. Additionally, you can obtain up to 10 points of extra credit.

This project will be discussed on Wednesday, November 25th.

Ideally, you re-use your scenegraph structure from project 3. But if you are not happy with it you can implement your project without a scenegraph structure.

Rendering the Lobby (20 Points)

We provide an OBJ file for the lobby, which includes the obstacles (boxes). Many thanks to Baichuan for converting this from a free online asset!

Load the OBJ model and display it on the screen. Map mouse movement to a virtual trackball rotation so that you can rotate the lobby about its center. Adjust its size so that it comfortably fits within your graphics window.

Create a directional light source to illuminate the lobby using the Phong shading model.

Note that the minimum requirement is to just load the OBJ file. You do not need to load and render the textures for it. This is an option for extra credit.

Below are two pictures of the lobby: without textures (left), with textures (right):

Amongus-lobby-gray.png Amongus-lobby-tex.png

Rendering the Astronauts (20 Points)

We provide three versions of the astronaut model (thanks to Baichuan for creating them!): one is the astronaut standing still, the other two are animation frames for the walking animation. Load each OBJ file into a separate data structure so that you can switch between the three animation stages as needed.

The astronaut files don't come with color. The only difference between the 10 astronauts in the scene is their colors. Here is a table of the astronaut colors. They are given as hex values for red, green and blue. Example: 132ED1 means: red is 13 hex = 19 decimal, green is 2E hex = 46 decimal, blue is D1 hex = 209 decimal. These are all in a range from 0 to 255, so to get them into the range of 0 to 1 you need to divide by 255.

Color Black Blue Brown Cyan Dark Green Lime Orange Pink Purple Red White Yellow
RGB 3E474E 132ED1 71491D 39FEDD 13802C 4EEF38 F17D0C EC54BB 6C2FBC C51211 D6DFF1 F6F657

Apply Toon shading: render the astronauts in their respective color, using the toon shading effect discussed in class (silhouette edges and discretized shading).

Below is a picture of what the astronauts should approximately look like:

Astronauts.png

Notes:

  • While the game labels each astronaut with the player names, you are not going to need to show any labels.
  • The game allows players to choose hats and other clothing. Our version is not going to do that.

Setting up Collision Detection

  • Create bounding spheres for all astronauts.
  • Create bounding spheres for the obstacles in the room (3 boxes).
  • Create bounding planes for the walls: 4 axis aligned walls, no need to implement diagonal walls.
  • Write an algorithm that checks for the collision of two bounding spheres.
  • Write an algorithm that checks for the collision of a bounding sphere with a wall.

Moving the Astronauts

1. Player astronaut:

  • Dedicate one of the astronauts to be the one the user controls with the keyboard (cursor keys or WASD keys).
  • Use bounding sphere-based collision detection to keep the astronaut from walking into obstacles (boxes), walls or other astronauts. When a collision is about to occur stop the astronaut's movement until the obstacle clears or the user chooses a different direction to go in.

2. Non-player astronauts:

  • Non-player astronauts should appear at random points in time and start walking in a randomized direction after a randomized period of time. They should walk along straight lines until they run into a wall, an obstacle (box) or another astronaut.
  • When they collide with something they should bounce off each other like pool billiard balls (angle of incidence = angle of reflection).
  • Occasionally (randomized) they should stop for a randomized amount of time, before they start walking again.

All astronauts always need to face the direction they walk in: this means that you need to rotate the astronaut model about its vertical axis according to the walking direction.

Notes:

  • The astronauts do not need to be animated (i.e., move their legs when walking). It is sufficient to always render the still standing model. Animation is an option for extra credit.

Player Appearance/Disappearance Effect

In the game, the astronauts materialize with an effect that creates a white halo around them, before they show up. We are NOT going to imitate this effect, but instead use a particle effect whenever an astronaut shows up or disappears. We also won't need the astronauts to appear in their respective seats like in the game, but they can show up anywere in the lobby as long as they don't collide with another astronaut or an obstacle.

Choose particle effects for the astronauts' appearance and disappearance. The effects must be different, but the difference can be minor. For instance, when they appear there might be points starting in the center point of the newly created astronaut's bounding sphere, moving away from that point. When disappearing, similar points might be traveling in the opposite direction. But your imagination is the limit, as long as you have a particle system with at least 100 particles. The particle animations should last about 3 seconds.

Extra Credit (10 Points)

You can get up to 10 points of extra credit by adding some or all of the features below:

1. Textures for lobby: parse the texture coordinates for the lobby file and render it with the proper textures. (3 points)

2. Animated astronauts: load all three astronaut files and switch between a walking animation (by alternating between the two walking models) when the astronaut is walking, and the still model when not. (3 points)

3. Sound effects: Add the following sound effects to your application: (5 points)

  • A sound effect for when players join, and a different one for when they leave the lobby.
  • A sound effect for whenever the player character moves (e.g., footsteps)

The sound effects should not cut each other, in other words, they should be able to play at the same time without forcing one another to pause or restart.

4. Shadows: use shadow mapping to render the astronauts' shadows on the ground. No other shadows need to be rendered. (5 points)

Submission Instructions

Once you are done with this project, record a video demonstrating all the functionality you have implemented.

The video should be no longer than 5 minutes, and can be substantially shorter.

Ideally, you will talk over the video to explain what you are showing. Alternatively, you can display text for this purpose.

To create the video you don't need to use video editing software, but you should use software to capture your screen to a video file.

  • For Windows users we recommend the free OBS Studio.
  • On Macs you can use Quicktime to record off the screen.

If this does not work for you, you can hold your phone in front of the screen and record with a steady hand.

Upload this video at the Assignment link on Canvas, and comment which functionality you have or have not implemented and what extra credit you have implemented. If you couldn't implement something in its entirety, please state which parts you did implement and hope to get points for.

  • Example 1: I've done the base project with no issues. No extra credit.
  • Example 2: Everything works except an issue with x, I couldn't get y to work properly.
  • Example 3: Sections 1-2 and 4 work.
  • Example 4: The base project is complete and I did z for extra credit.

Finally, zip up your source code (.cpp, .h, executable and shader files, as well as any .obj files which were not provided to you) and submit the zip file at the Assignment link on Canvas as well.