Built in 2 Weeks · 100% Pure Java · Zero Dependencies · No Maven/Gradle · Just Clone and Run in IntelliJ
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.
JLinkedList<T>✅JArrayList<T>✅JAVLTree<T>✅JStack<T>✅JQueue<T>✅JTrees<T>✅JGraph<T>✅JHeap<T>✅
.get(),.set(), forJArrayListandJLinkedList.add(),.remove(), forJArrayList,JLinkedList,JHeaps,JAVLTree.push(),.pop(), forJStackand.offer()and.poll()forJQueue.isGreater(),.isSmaller(),.isGreaterOrEqual(),.isSmallerOrEqual()forJArrayList.addVertex(),.removeVertex(),.addEdge(),.removeEdge(),.dfs(),.bfs()forJGraph.getMin(),.getMax(),.getHeight(),.search(),.leaves(),.preorder(),.postorder(),.inorder()forJAVLTreeandJTrees
- Minimal ray tracer created, basic
JBoxclass drawn with numbers. - Array-based box line generation:
.add(5)triggers an animated sliding box. - Added insertion + deletion animation.
- Implemented video generation using FFmpeg.
- Introduced
JArrayListAnimator, separating rendering, box animation, and camera logic. .withSubtitles(),.withInsertAnimation(),.withDeleteAnimation()added.- Introduced builder-style API like
JArrayList<Integer> list = new JArrayList<>().withXYZ()
- Added rendering optimizations and GUI progress bars.
- Introduced live rendering mode.
- Randomize camera, texture, insert animations.
- Subtitle system added with perfect frame-by-frame sync.
- Modes:
VIDEO,LIVE,STEP_WISE,STEP_WISE_INTERACTIVE.
- Encoders optimized with shared FFMPEG stream logic (12 edge cases handled!).
- Quality, naming, reuse of encoder logic finalized.
- Screen resolution scale chaining added.
JStacks,JQueues,JTreesdone.JGraphs,JHeaps,JAVLTreealso done.- Added sorting/searching:
bubble,selection,insertion,binary search,DFS,BFSetc. - Fully type-generic:
JArrayList<String>,JTree<Double>etc. work out of the box.
- Java 17+
- IntelliJ IDEA (recommended)
- No Maven. No Gradle.
git clone https://github.com/aryanbatras/DSA-IN-3D- Open the project in IntelliJ.
- Navigate to
Main.java - Click Run — done!
- Open IntelliJ
- Click on Clone Repository
- Paste the URL:
https://github.com/aryanbatras/DSA-IN-3D - Click on Clone
- Open the project in IntelliJ.
- Navigate to
Main.java - Click Run — done!
- Download the DSA-IN-3D.jar from Releases
- Place it in your project folder or add it via IntelliJ:
- File → Project Structure → Libraries → + → Add JAR/Directory
- 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);
}
}- Compile & Run the Program
On macOS/Linux:
javac -cp "DSA-IN-3D.jar" Main.java java -cp ".:DSA-IN-3D.jar" MainOn 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.
// ✅ 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);
}
}
}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();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.
- Every structure can be customized independently using the .with() API
- Run each one in a different render mode ( LIVE, VIDEO, STEP_WISE )
- Use distinct camera angles, textures, backgrounds, and animation speeds
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.
LIVE– live visualizationVIDEO– export to high-quality.mp4STEP_WISE– step-by-step visualizationSTEP_WISE_INTERACTIVE– full mouse/keyboard camera
- Adding new structures:
JTrie,JSkipList,JSegmentTree, etc. [Recommended] - Improving animation logic or visual effects
- Fixing bugs / improving performance
- Creating new
.with()APIs
- 🧠 3500+ lines of pure Java
- 🎞️ 12+ algorithm visualizations
- 🧱 30+ animator and structure classes
- 🚀 Built completely in 2 weeks of effort
- 🌄 Built-in ray tracing with realistic HDR
- 🧰 25+
.with()customizable API flags
- Custom ray tracer with reflections + soft shadows
- Resolution, naming, quality chaining support
- Shared FFMPEG encoder optimization
- Subtitle rendering with exact timing
- Frame-by-frame animation syncing
- Multi-structure shared scenes
- Interactive camera logic
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.