Java Clean Architecture Masterclass

Java Clean Architecture MasterclassNov 20-21

Join

DSA-IN-3D: 3D Data Structure Visualizer In Java

Built in 2 Weeks Β· 100% Pure Java Β· Zero Dependencies Β· No Maven/Gradle Β· Just Clone and Run in IntelliJ


πŸŽ₯ Watch Demo on YouTube


πŸ”₯ What is DSA-IN-3D?

DSA-IN-3D is a full-fledged 3D data structure visualizer built from scratch in Java.

It’s made to educate, demonstrate, and inspireβ€”perfect for students, teachers, and curious developers who want to see algorithms and data structures come alive in 3D

It features ray tracing, realistic rendering, camera animations, interactive and video modes, and an intuitive .with() API inspired by the Java Collections framework.

πŸ’‘ Features & Customizations

🧱 Supported Data Structures

🎞️ Operation Visualizers


🚧 Our Development Journey

Phase 1: Basic Setup and Vision

Phase 2: Library-Like Architecture

Phase 3: Rendering Challenges & Optimization

Phase 4: Randomness & Subtitles

Phase 5–6: Shared Rendering Pipeline

Phase 7–8: Data Structures + Algorithms


βš™οΈ Getting Started

πŸ”§ Requirements

πŸ’» Run it Now

Using Git Clone

git clone https://github.com/aryanbatras/DSA-IN-3D
  1. Open the project in IntelliJ.
  2. Navigate to Main.java
  3. Click Run β€” done!

Using Just Intellij

  1. Open IntelliJ
  2. Click on Clone Repository
  3. Paste the URL: https://github.com/aryanbatras/DSA-IN-3D
  4. Click on Clone
  5. Open the project in IntelliJ.
  6. Navigate to Main.java
  7. Click Run β€” done!

πŸ“¦ Using the JAR File in Your Own Project

  1. Download the DSA-IN-3D.jar from Releases
  2. Place it in your project folder or add it via IntelliJ:
  3. File β†’ Project Structure β†’ Libraries β†’ + β†’ Add JAR/Directory
  4. Create Your Own Main.java

// Main.java

import Collections.*;
import Animations.*;
import Algorithms.*;
import Rendering.*;

public class Main {
public static void main(String[] args) {
    
// Create your structure
JArrayList<Integer> arr = new JArrayList<>();

        // Customize it with infinite possibilities
        arr
            .withRemoveAnimation(Exit.SHRINK_AND_DROP)
            .withInsertAnimation(Entrance.BOUNCE)
            .withBackground(Scenery.GLASS_PASSAGE)
            .withQuality(Resolution.BALANCE)
            .withRenderMode(Render.VIDEO)
            .withOutput("my_array.mp4")
            .build();

        // Perform some operations
        arr.add(10);
        arr.add(20);
        arr.add(30);
        arr.remove(1);
    }
}
  1. Compile & Run the Program

On macOS/Linux:

javac -cp "DSA-IN-3D.jar" Main.java
java -cp ".:DSA-IN-3D.jar" Main

On Windows:

javac -cp "DSA-IN-3D.jar" Main.java
java -cp ".;DSA-IN-3D.jar" Main

βœ… That's it! Your customized 3D animation will be saved as an .mp4 file in your working directory.


πŸ› οΈ Configurable Options



// βœ… Create your data structure
JArrayList<Integer> arr = new JArrayList<>();

// βœ… Perform usual operations
arr.add(10);
arr.add(20);
arr.add(30);
arr.add(40);
arr.add(50);
arr.remove(0);
arr.remove(2);

// ⚠️ Nothing will be rendered unless you configure and call .build()

// πŸ”€ Randomizer-based configuration
arr
  .withInsertAnimation(Dynamo.randomInsertAnimation())
  .withRemoveAnimation(Dynamo.randomRemoveAnimation())
  .withBackground(Dynamo.randomBackground())
  .withMaterial(Dynamo.randomMaterial())
  .withParticle(Dynamo.randomParticle())
  .withStepsPerAnimation(Frames.NORMAL)
  .withRenderMode(Render.STEP_WISE)
  .withQuality(Resolution.FASTEST)
  .build();

// πŸŽ‰ Surprise mode: total chaos!
arr
  .withRandomizer(
  Dynamo.INSTANCE
          .withCrazyMode()
          .withoutRenderMode()
          .withoutQuality()
          .withoutSteps()
   )
    .withStepsPerAnimation(Frames.NORMAL)
    .withQuality(Resolution.BALANCE)
    .withRenderMode(Render.LIVE)
    .build();

// 🎨 Fine-grained custom animation config
arr
  .withBackgroundChangeOnEveryOperation(true)
  .withRemoveAnimation(Exit.SHRINK_AND_DROP)
  .withStepsPerAnimation(Frames.VERY_SLOW)
  .withCameraRotations(View.ROTATE_YAW)
  .withInsertAnimation(Entrance.BOUNCE)
  .withQuality(Resolution.FASTEST)
  .withMaterial(Texture.CHROME)
  .withParticle(Effect.AURORA)
  .withAntiAliasing(Smooth.X2)
  .withCameraFocus(Zoom.X16)
  .withCameraSpeed(Pace.X4)
  .build();

// πŸŽ₯ Create your own video
arr
  .withSharedEncoder(true)
  .withRenderMode(Render.VIDEO)
  .withQuality(Resolution.BALANCE)
  .withStepsPerAnimation(Frames.NORMAL)
  .withBackground(Scenery.GLASS_PASSAGE)
  .withOutput("randomizer.mp4")
  .build();

// πŸ” Use inbuilt algorithms

// Option 1: Direct configuration and run
arr
  .withAlgoVisualizer(Array.BUBBLE_SORT)
  .withStepsPerAnimation(Frames.NORMAL)
  .withRenderMode(Render.STEP_WISE)
  .withQuality(Resolution.BALANCE)
  .build()
  .run();

// Option 2: Minimal syntax
Array.BUBBLE_SORT.run(arr);

// Or ✍️ Write your own algorithm visually
for (int i = 0; i < arr.size() - 1; i++) {
    for (int j = 0; j < arr.size() - i - 1; j++) {
        if (arr.isGreater(j, j + 1)) {
            int temp = arr.get(j);
            arr.set(j, j + 1);
            arr.set(j + 1, temp);
        }
    }
}

πŸ”— Chain Video Encoders

You can chain multiple data structures together, run them in same or different modes, and render using custom or shared encoders. Both will use the same encoder stream and render in sequence as you write your code !

JArrayList<Integer> arr = new JArrayList<>()
.withRenderMode(Render.VIDEO)
.withSharedEncoder(true)
.build();

JStack<Integer> stack = new JStack<>()
.withRenderMode(Render.VIDEO)
.withSharedEncoder(true)
.build();

πŸ”— Infinite Customization & Multi-Structure Scenes

DSA-IN-3D supports not only supports individual data structure animations but also the ability to chain and combine multiple structures together in a single scene. You can create a JArrayList, a JTree, and a JGraph side by side each with its own unique animations, styles, and rendering configurations.

    JAVLTree avl = new JAVLTree()
        .withRandomizer(Dynamo.INSTANCE.withCrazyMode().withoutQuality().withoutRenderMode().withoutSteps())
        .withQuality(Resolution.BEST).withRenderMode(Render.LIVE).build();

    JLinkedList list = new JLinkedList()
        .withRandomizer(Dynamo.INSTANCE.withCrazyMode().withoutQuality().withoutRenderMode().withoutSteps())
        .withQuality(Resolution.BEST).withRenderMode(Render.STEP_WISE).build();
        
    JStack stack = new JStack()
        .withRandomizer(Dynamo.INSTANCE.withCrazyMode().withoutQuality().withoutRenderMode().withoutSteps())
        .withQuality(Resolution.BEST).withRenderMode(Render.STEP_WISE_INTERACTIVE).build();
       
        int value;
        Random rand = new Random();
        for(int i = 0; i < 5; i++) {
            value = rand.nextInt(100);
            stack.push(value);
            list.add(value);
            avl.add(value);
        }        

With infinite customization, DSA-IN-3D is the ultimate tool to bring your data structures and algorithms to life in 3D.


🌈 Modes of Usage


🌍 Contributions Welcome


πŸ“Š Big Numbers, Big Effort


🧠 Challenges We Solved


πŸ“Œ License & Credits

License: Apache 2.0

Made by: Aryan Batra @aryanbatras

Special Thanks To: Everyone who joins this mission to make data structures visual, beautiful, and joyful.

Java License Built With


Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.