Bevy Tutorial: Build Your First 3D Editor - Create a 3D Space on an Infinite Grid | AIBodh
On AI assistance<br>"Bodh" in "AIBodh" means understanding. Since conversational AI first arrived, the main thing I kept coming back to it for was learning, asking, getting it wrong, asking again, until something finally made sense. That turned into a belief I still hold: used well, AI can genuinely help people learn. So I use it for teaching, but not as a shortcut. Each article still takes me 20 to 25 hours. AI is how I get through the parts of writing that are genuinely hard: finding the example where a concept is the obvious answer, the analogy that clicks, the visual that makes it concrete, the pass that cuts the jargon and the bloat. I verify the code runs, I keep the voice mine, and I cut anything that does not help you understand. The judgment and the corrections stay with me. If anything feels off in any section, let me know on Discord and I'll work on it.
I’ve been following the Bevy 0.19 release and kept asking myself: what’s something cool to build with all the new building blocks 0.19 is shipping? I tinkered around and ended up with a small 3D editor inspired by Blender.
A 3D editor sounds big, but our focus is a simple scene editor to build environments, place enemies, etc. Any game that has a world needs some way to author it.
In this series we’ll build a simple one for exactly that purpose, something you can extend however your game needs. The nice part about building this in Bevy is that your editor and your game share the same ECS, so the scene you save is the scene your game loads.
Which brings up the usual question. Should you actually build your own game editor, or wait for the official one, or just hand author your scenes in code? I’m not touching that debate with a ten-foot pole. Whatever you pick, someone in the internet will tell you you’re wrong anyway.
The principle
Here’s what I plan to cover in this tutorial series:
A mini 3D editor inspired by Blender
Move, rotate, and resize with keyboard shortcuts
Change object materials, create a toon shader
Save and load scenes
Import GLTF models
Everything listed above will ship as free blog posts. That part is settled. What I haven’t figured out yet is whether there will be any extra material beyond this list, and if so, whether it would be pay-gated. So treat the free posts as the plan, and anything past them as a maybe.
In this tutorial, we will focus on the following:
A small 3D scene you can move around in like Blender
A grey cube in the middle
An infinite ground-plane grid with a red X axis and a green Y axis
A camera to orbit around the 3D space.
Your browser does not support the video tag.
Before We Begin: I'm constantly working to improve this tutorial. If anything trips you up, or if you want to see what's coming next, drop a note on Reddit / Discord / LinkedIn. Loved it? Let me know what worked.
This tutorial assumes you’re comfortable with structs, enums, associated functions and closures, all covered in our Bevy 2D Game Development series, Chapters 1–7. If any of those feel shaky, those chapters are free and worth a read first.
Project Setup
The source code for the series and each episode is available in this repo.
cargo new bevy_tutorial_editorcd bevy_tutorial_editor
Replace Cargo.toml with:
Cargo.toml<br>[package]name = "bevy_tutorial_editor"version = "0.1.0"edition = "2024"[dependencies]bevy = "=0.19"# Bevy's recommended dev build profile..[profile.dev]opt-level = 1[profile.dev.package."*"]opt-level = 3
Scene Setup
Every 3D scene needs exactly three things to be visible:
A camera , something to look through
A light , something to illuminate the scene
A mesh , something to look at
Let’s start here and see where it leads.
src/main.rs<br>Replace main.rs with the following code.<br>use bevy::prelude::*;Entry pointEvery Bevy program starts the same way: build an App, register what it should do, then call run(). The app then loops forever, ticking its systems each frame.fn main() { App::new() .add_plugins(DefaultPlugins)+Pulls in ~20 built-in plugins at once: the window, the renderer, input handling, and asset loading. .add_systems(Startup, setup_scene)+Run setup_scene a single time, at startup. .run();}Systems are just functionsBevy runs this for you, you have to mention when it needs to be triggered. Also note we don't pass arguments when adding it as a system (explained later).fn setup_scene( mut commands: Commands,+Lets you change the world, spawn entities (player, enemy, objects) and attach components to them. Bevy applies the changes once the system finishes. mut meshes: ResMutAssetsMesh>>,+Lets you add or remove meshes, the app's shared store of every mesh shape. mut materials: ResMutAssetsStandardMaterial>>,+Lets you add or remove materials, the app's shared store of every surface look.) {Adding cameraWithout a camera, nothing is drawn. Its Transform places it back and above the origin, then aims it at the...