Tutorial: Minimal Scene
Create your first MC3 scene from scratch — in the editor and by hand-editing XML.
Approach 1: Using the Editor
Step 1 — Start with a new scene
Launch MeshCraft with no arguments, or press Ctrl+N to create a new empty scene.
./cmake-build-debug/MeshCraft
Step 2 — Add a ground plane
- Press
F5or click the Plane button in the toolbar. - In the Properties panel (right side), set:
- Name:
Ground - Size:
20 20 - Axis:
y
- Name:
Step 3 — Add a box
- Press
F1or click the Box button in the toolbar. - In the Properties panel, set:
- Name:
Cube - Position:
0 0.5 0 - Size:
1 1 1
- Name:
Step 4 — Create a material
- In the Properties panel, click the Materials tab.
- Click + Add Material.
- Name it
grey. - Set Base Color to R=0.7, G=0.7, B=0.7, A=1.0.
Step 5 — Assign materials to objects
- Click on the Ground plane in the Hierarchy panel.
- In the Properties panel (Object tab), set Material to
grey. - Do the same for the Cube.
Step 6 — Add a light
- Click the Lights tab in the Properties panel.
- Click + Add Directional.
- Set Direction:
-0.5 -1 -0.3, Brightness:2.5. - Click + Add Ambient. Set Color:
0.3 0.3 0.4, Brightness:0.4.
Step 7 — Save
Press Ctrl+S. Enter a path such as my_scene.mc3.xml.
Approach 2: Hand-Editing XML
Create a file named my_scene.mc3.xml with this content:
<?xml version="1.0" encoding="UTF-8"?>
<mc3 version="0.3" model="MinimalScene">
<environment>
<background color="0.4 0.6 0.9"/>
</environment>
<lights>
<ambient color="0.3 0.3 0.4" brightness="0.4"/>
<directional name="Sun" color="1 0.95 0.8"
brightness="2.5" direction="-0.5 -1 -0.3"/>
</lights>
<materials>
<material id="grey" roughness="0.8">
<base_color>0.7 0.7 0.7 1.0</base_color>
</material>
</materials>
<objects>
<plane name="Ground" size="20 20" axis="y" material="grey"/>
<box name="Cube" size="1 1 1" position="0 0.5 0" material="grey"/>
</objects>
</mc3>
Then open it in the editor:
./cmake-build-debug/MeshCraft my_scene.mc3.xml
What You Should See
- A grey flat plane (the ground).
- A grey box sitting on it.
- A sky-blue background.
- Lighting from the directional "Sun" light.
Next Steps
- Press
Fto focus the camera on the selection. - Press
G, then drag the box with your mouse to move it. - Try adding a cylinder (
F3) or sphere (F2). - See CSG Operations to combine shapes.
- See Export to glTF/GLB to use this scene in a game engine.