Back to projects

ch.imgajeed.PhysicsEngine

3D wireframe rendering engine from scratch in Kotlin using Java Swing. My first 3D graphics project from March 2021.

Updated Feb 6, 2026
Repository

PhysicsEngine

A 3D wireframe rendering engine built from scratch in Kotlin using Java Swing.

Note: This was one of my first projects, created in March 2021 when I was 13. The code remains unchanged from the original - this README was added later for archival purposes.

What it does

  • Renders 3D cubes as wireframes
  • First-person camera with WASD + mouse look
  • Custom matrix math library for 3D transformations
  • Perspective projection (world space → screen space)

Controls

KeyAction
W/SMove forward/backward
A/DStrafe left/right
SpaceMove up
ShiftMove down
MouseLook around
ESCRelease mouse

How it works

The engine implements the 3D graphics pipeline manually:

  1. Matrix.kt - Generic matrix class with multiplication
  2. Math3d.kt - 4x4 transformation matrices (translation, rotation X/Y/Z, perspective projection)
  3. Cube.kt - 8 vertices defined in 3D, projected to 2D for rendering
  4. Camera.kt - Position, rotation, and input handling
  5. Window.kt - Java Swing rendering loop

No OpenGL, no game engine - just Graphics.drawLine() and math.

Running

Requires Kotlin and Java. Built with Gradle.

./gradlew run

Author

Oliver Seifert (@ImGajeed76) - March 2021

About ch.imgajeed.PhysicsEngine

What is ch.imgajeed.PhysicsEngine?

ch.imgajeed.PhysicsEngine is 3D wireframe rendering engine from scratch in Kotlin using Java Swing. My first 3D graphics project from March 2021.. It is built with Kotlin and maintained by Oliver Seifert.

What language is ch.imgajeed.PhysicsEngine written in?

ch.imgajeed.PhysicsEngine is primarily written in Kotlin (100% of the codebase).

Most Similar to ch.imgajeed.PhysicsEngine

Explore Something Different from ch.imgajeed.PhysicsEngine