Porta Inversa is a 3D first-person survival horror game built from scratch using pure Java and OpenGL (JOGL). Developed for the Computer Graphics Lab (Professor Anupama Arun), this project demonstrates practical implementations of complex 3D math, global matrix transformations, and dynamic rendering pipelines.
You are trapped in a surreal, non-Euclidean maze. The moment you spawn, The Watcher—a hostile, ghostly red entity—will begin dynamically tracking your coordinates.
You must survive for exactly 60 seconds. You cannot outrun it forever. You must use the environment's portals and gravity mechanics to outmaneuver it. (Note: If you die, simply press Space to instantly restart the physics loop).
Space- Start Game / Restart Game / JumpWASD- MovementMouse- 360° FPS Camera (Pitch/Yaw)Shift- SprintEsc- Quit Game / Free Mouse Pointer
This engine was built without a pre-existing game engine (like Unity or Unreal) to explicitly demonstrate foundational CG mathematical concepts:
- Spherical Coordinate Camera System: Generates true 3D look-vectors using sine and cosine functions to calculate dynamic pitch and yaw. Includes vertical angle clamping to prevent gimbal lock.
- Dynamic Vector Normalization: "The Watcher" AI relies on continuous frame-by-frame distance calculations. It normalizes the vector between itself and the player's camera to create a flawless, relentless pursuit path.
- Global Matrix Transformations: The gravity-flipping mechanic applies a continuous 180-degree
glRotatefover the entire scene's geometry, flawlessly shifting the floor to the ceiling. - Orthographic UI Pipelines: Dynamically swaps the OpenGL projection matrix from
GL_PROJECTIONto Orthographic to render the 2D Heads-Up Display, timer, and a real-time motion-tracking minimap. - AABB Collision Geometry: Implements custom Axis-Aligned Bounding Boxes and positional flag tracking to handle portal teleportation logic and hit-detection.
- Clone the repository.
- Ensure you have the JOGL (Java OpenGL)
.jarfiles referenced in your Java workspace. - Run
PortaInversa.java.