Overview
The 3D viewport is the heart of the G3Engine editor, providing real-time rendering, interactive object manipulation, and visual feedback for your game world.The 3D editor uses WebGL rendering with ACES Filmic tone mapping for cinematic visuals right out of the box.
Core Features
Scene Objects
G3Engine supports a comprehensive set of primitive 3D objects:- Meshes
- Lights
- Other
- Cube - Basic box geometry
- Sphere - Spherical geometry with configurable detail
- Cylinder - Cylindrical shapes for pillars, columns
- Plane - Flat surfaces for floors, walls
- Cone - Conical geometry
- Torus - Donut-shaped geometry
Visual Controls
Transform Gizmos
Interactive 3D gizmos let you manipulate objects directly in the viewport:Select an Object
Click any object in the scene to select it. Selected objects display a transform gizmo.
Choose Transform Mode
Use keyboard shortcuts to switch modes:
- Press
Wfor Translate (move) - Press
Efor Rotate - Press
Rfor Scale
Camera Navigation
The viewport uses OrbitControls for intuitive 3D navigation:- Rotate: Left-click + drag
- Pan: Right-click + drag or Middle-click + drag
- Zoom: Scroll wheel
- Damping: Smooth camera movement with inertia
Grid and Guides
The editor provides visual guides to help with object placement:- Infinite Grid: Dynamically fades based on camera distance
- Grid Spacing: 1 unit cells, 5 unit sections
- Origin Marker: Visible at world (0,0,0)
- Gizmo Helper: Bottom-right orientation helper showing XYZ axes
The grid and gizmo helpers are automatically hidden during Play Mode to show you exactly what players will see.
Keyboard Shortcuts
The 3D editor supports extensive keyboard shortcuts for rapid workflow:| Shortcut | Action |
|---|---|
W | Switch to Translate mode |
E | Switch to Rotate mode |
R | Switch to Scale mode |
Space | Toggle Play Mode |
Delete / Backspace | Delete selected object |
Cmd/Ctrl + D | Duplicate selected object |
Cmd/Ctrl + Z | Undo |
Cmd/Ctrl + Shift + Z | Redo |
Material System
Every object has a physically-based material with customizable properties:Material Examples
- Plastic
- Metal
- Glowing
Lighting System
G3Engine provides cinematic lighting out of the box:Default Scene Lighting
Custom Lights
Add your own lights from the Asset Library:Point Light
Omnidirectional light emanating from a point. Great for lamps, candles, explosions.Properties:
intensity, color, positionDirectional Light
Parallel light rays like the sun. Ideal for outdoor scenes.Properties:
intensity, color, position, castShadowPlay Mode
Test your scene in real-time without leaving the editor:Enter Play Mode
Press
Space or click the Play button. The viewport overlay shows a recording indicator.Test Gameplay
Interact with your scene. Transform gizmos and grid are hidden to show the player view.
Scene Hierarchy
All scene objects are stored in a flat array with unique IDs:Transform System
Transforms are applied in standard order: Position → Rotation → ScaleHistory & Undo System
The editor maintains a complete history of scene states:- Automatic snapshots after each transform, add, delete, or duplicate operation
- Unlimited undo/redo via
Cmd/Ctrl + ZandCmd/Ctrl + Shift + Z - History navigation preserves exact object states including materials
Contact Shadows
Realistic ground contact shadows are rendered automatically:Performance Optimization
The 3D editor is optimized for smooth 60fps performance:- Selective rendering: Only visible objects are rendered
- Efficient state updates: Transform updates don’t trigger full re-renders
- Optimized geometries: Primitives use appropriate segment counts
- Shadow optimization: Contact shadows for soft shadows, shadow maps only when needed
Object Selection
Click objects to select them. Selection state controls:- Transform gizmo visibility
- Inspector panel updates
- Keyboard action targets
Object selection is disabled during Play Mode to allow gameplay interaction testing.
Next Steps
2D Editor
Build 2D games and UI with sprite-based editing
Visual Scripting
Add gameplay logic without coding
Asset Library
Browse and add objects to your scene
Web3 Integration
Connect blockchain features to your game