OpenGL Computer Graphics Animated Interactive Scence

2 minute read

Overview

This project is an OpenGL application based on Lightweight Java Game Library (LWJGL). It includes the designs and implementations of several sophisticated objects. There are also multiple complicated movements of objects triggered by well-designed interactions with users. An object relative position and collision detection system is also implemented.

Interactions

  1. Users are able to move the mouse horizontally to change the direction of the magician and let the magician move according to the direction.
  2. Users are able to move the mouse vertically to look up and down
  3. There are collision detection for every object in the scene
  4. Only if users stand near by and in front of the door of a box and type “F”, the door will open/close. When the door is open, the magician is able to go into/out of the box, and when it is closed, the magician can not go into/outside.
  5. The middle of a magic box is able to be bulge and go back
  6. The thing the magician holds can be changed by scrolling the mouse wheel
  7. For different thing the magician hold, the interactions and actions are different
  8. The assistant can do the action and when the color of octahedron will be changed and the audiences will clap.
  9. Switch between first-person perspective and third-person perspective
  10. Go between the first layer and the second layer by the lift which is the magic box in the center
  11. There are collision detection in the second layer
  12. Users are able to let the horse of the magician appear/disappear, when the magician is riding a horse, the speed will be faster

Operations

  1. Move the mouse horizontally: Change the direction of the magician
  2. Move the mouse vertically: Look up and Down
  3. W, A, S, D: Let the magician move forward, right, backwards and left. The magician will move according to the direction.
  4. F: Open/Close doors of boxes. Users have to stand in front a door and near the door to open/close it.
  5. U/I: Let the right box bulge/go back.
  6. Scroll the mouse wheel: Change the thing that the magician holds.
  7. Click the left button of the mouse/Keep the left button of the mouse down: Let the magician do different actions according to the thing he holds. The interaction will also be different when the magician do different actions. For example, if the magician holds a magic bar, it waves the magic bar and after the waving, its assistant will disappear/appear and when the magician holds nothing, he waves his arm and the audience will clap.
  8. T: Let the assistant do his action. In the story of this project, only when the assistant goes out of a magic box, he does the action. Therefore, after the action, the color of the octahedrons above the magician and the assistant will change which shows that they are tired and the audiences will clap because they finished a show.
  9. V: Switch between first-person perspective and third-person perspective
  10. E: If the magician is in the middle box which is also a lift, the lift will go down/up which will take the magician to the second/first layer.
  11. P: Let the horse of the magician appear/disappear. When the magician is riding a horse, the speed is faster and the collision still exists.
  12. UP, DOWN, LEFT, RIGHT: Let the assistant move forward, right, backwards and left.

Demo