3D editor for spacecraft thruster placement and configuration
Live Demo โข Report Bug โข Request Feature
KSA-TPT is a web-based 3D editor designed for in the KSA (Kitten Space Agency) Pre-Alpha. It provides a visual interface for placing, orienting, and configuring RCS thrusters on 3D models, then exporting their configuration to KSA-compatible XML format.
- Visual 3D Editing - Interactive placement and rotation of thrusters with real-time visual feedback
- GLB Model Support - Import and visualize your spacecraft models in glTF binary format
- Precision Controls - Fine-tune thruster positions and directions with numerical inputs
- Thruster Configuration - Set thrust values, specific impulse, and other physical parameters
- Transform Modes - Switch between translate and rotate modes with keyboard shortcuts (T/R)
- XML Export - Generate game-ready XML configuration files
- Interactive 3D canvas powered by Three.js and React Three Fiber
- Orbit controls with smooth damping for easy navigation
- Axis-aligned views - Snap to front, back, left, right, top, or bottom views
- Grid and axis helpers for spatial reference
- Real-time gizmo visualization showing thruster positions and exhaust directions
- Add/Remove thrusters with instant visual feedback
- Duplicate thrusters to speed up symmetric configurations
- Visual gizmos - Orange spheres with yellow directional cones
- Transform controls - Interactive translate and rotate gizmos
- Properties panel with comprehensive parameter editing
- Position editing - X, Y, Z coordinates with 0.001m precision
- Direction editing - Exhaust vector control with visual feedback
- Transform modes - Translate (T) and Rotate (R) with keyboard shortcuts
- Snap-to-axis views - Quick orthogonal camera positioning
- Reset rotation - One-click return to default orientation
- ๐ One-click XML export to clipboard
- ๐ฎ Game-compatible format with proper coordinate mapping
- โ๏ธ Full parameter support including:
- Thrust (Newtons)
- Specific Impulse (seconds)
- Minimum pulse time
- Control mappings
- Volumetric exhaust effects
- Sound events
- Node.js 18.x or higher
- npm 9.x or higher (or pnpm / yarn)
-
Clone the repository
git clone https://github.com/MrAndroPC/KSA-TPT.git cd KSA-TPT -
Install dependencies
npm install
-
Start development server
npm run dev
-
Open your browser
http://localhost:5173
npm run build
npm run preview # Preview production build locallynpm run deploy-
Import a Model
- Drag and drop a
.glbfile into the import zone, or click to browse - Your 3D model will appear in the viewport
- Drag and drop a
-
Add Thrusters
- Click the "+ Add" button to create a new thruster
- The thruster appears at the origin with default properties
-
Position Thrusters
- Select a thruster from the list
- Press T for translate mode or R for rotate mode
- Use the 3D gizmo to move and rotate the thruster
- Or manually enter coordinates in the properties panel
-
Configure Properties
- Set the thruster ID and control mapping (e.g., "TranslateRight")
- Adjust thrust, specific impulse, and pulse time
- Configure visual effects and sound events
-
Export Configuration
- Click "Copy XML" to copy the configuration to clipboard
- Paste into your game's configuration file
| Key | Action |
|---|---|
| T | Switch to Translate mode |
| R | Switch to Rotate mode |
| Click Axis Gizmo | Snap to orthogonal view |
| Click Axis Again | Flip to opposite view |
- X-axis (Red) - Front/Back (Game forward is +X)
- Y-axis (Green) - Right/Left
- Z-axis (Blue) - Up/Down
Exhaust Direction: The yellow cone shows the exhaust direction. For a thruster to push the spacecraft forward, the exhaust should point backward (toward -X by default).
| Technology | Version | Purpose |
|---|---|---|
| React | 19.2.0 | UI framework |
| TypeScript | 5.9.3 | Type safety |
| Vite | 7.2.2 | Build tool & dev server |
| Three.js | 0.181.1 | 3D rendering engine |
| React Three Fiber | 9.4.0 | React renderer for Three.js |
| @react-three/drei | 10.7.7 | Three.js helpers & controls |
| Zustand | 5.0.8 | State management |
| fast-xml-parser | 5.3.2 | XML serialization |
- ESLint - Code linting with TypeScript support
- gh-pages - Automated GitHub Pages deployment
KSA-TPT/
โโโ public/ # Static assets
โ โโโ vite.svg
โโโ src/
โ โโโ assets/ # Images and icons
โ โ โโโ react.svg
โ โโโ components/ # React components
โ โ โโโ AxisGizmo.tsx # Axis view controller
โ โ โโโ ExportXmlPanel.tsx # XML export interface
โ โ โโโ ImportDropZone.tsx # Model import
โ โ โโโ LoadedModel.tsx # 3D model renderer
โ โ โโโ ModelInfoPanel.tsx # Model information display
โ โ โโโ SceneRoot.tsx # Main 3D scene
โ โ โโโ ThrusterGizmo.tsx # Individual thruster visualization
โ โ โโโ ThrusterListPanel.tsx # Thruster list UI
โ โ โโโ ThrusterPropertiesForm.tsx # Properties editor
โ โ โโโ ThrustersGizmos.tsx # All thrusters renderer
โ โ โโโ TransformModeToolbar.tsx # Mode switcher
โ โ โโโ ViewportCanvas.tsx # 3D viewport container
โ โโโ lib/ # Core logic
โ โ โโโ thrusterSchema.ts # Data models
โ โ โโโ xmlSerializer.ts # XML export logic
โ โโโ state/ # State management
โ โ โโโ editorStore.ts # Editor state (modes, views)
โ โ โโโ modelStore.ts # 3D model state
โ โ โโโ thrustersStore.ts # Thrusters data
โ โโโ App.tsx # Root component
โ โโโ main.tsx # Application entry
โ โโโ index.css # Global styles
โโโ index.html # HTML template
โโโ package.json # Dependencies
โโโ tsconfig.json # TypeScript config
โโโ vite.config.ts # Vite configuration
โโโ README.md # This file
Strict type checking is enabled for maximum code quality. See tsconfig.json and tsconfig.app.json.
Modern flat config format with React and TypeScript rules. See eslint.config.js.
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m 'Add some amazing feature' - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
- Follow the existing code style
- Add TypeScript types for all new code
- Test your changes thoroughly
- Update documentation as needed
- Y and Z coordinates are intentionally swapped in some places in code
- Large models are loading quite a long time
- You can't move your cursor when you trying to enter orthgrapic view
- Three.js community for the excellent 3D library
- React Three Fiber for the React integration
- KSA community for inspiration and testing
Project Link: https://github.com/MrAndroPC/KSA-TPT
โญ Star this repository if you find it helpful!
Made with โค๏ธ for the KSA Modding Community